/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * SAR.java
 *
 * Created on May 5, 2011, 17:28:54 PM
 */

package gace.forms;

import gace.dao.ClienteDao;
import gace.dao.PaqueteDao;
import gace.dao.ServicioDao;
import gace.dao.UsuarioDao;
import gace.logica.Cliente;
import gace.logica.Habitacion;
import gace.logica.Paquete;
import gace.logica.Renta;
import gace.logica.Reserva;
import gace.logica.Servicio;
import gace.logica.Usuario;
import gace.logica.Venta;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import javax.swing.JTable;
import javax.swing.ListSelectionModel;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import javax.swing.table.DefaultTableModel;

/**
 *
 * @author german
 */
public class SAR extends javax.swing.JFrame {


    DefaultTableModel tablaUsuarios = new DefaultTableModel(null, new String[]{"ID", "NOMBRE", "APELLIDOS", "DIRECCION"});
    DefaultTableModel tablaClientes = new DefaultTableModel(null, new String[]{"ID", "NOMBRE", "APELLIDOS", "DIRECCION", "TELEFONO"});
    DefaultTableModel tablaPaquetes = new DefaultTableModel(null, new String[]{"ID", "NOMBRE", "DESCRIPCION", "PRECIO"});
    DefaultTableModel tablaServicios = new DefaultTableModel(null, new String[]{"ID", "NOMBRE", "PRECIO"});
    DefaultTableModel tablaServicios2 = new DefaultTableModel(null, new String[]{"NOMBRE"});
    DefaultTableModel tablaServiciosEscogidos = new DefaultTableModel(null, new String[]{"NOMBRE"});
    DefaultTableModel tablaReservas = new DefaultTableModel(null, new String[]{"ID CLIENTE","NOMBRE","APELLIDOS","ID RESERVA", "F INICIO", "F FIN", "F RESERVA","HABITACION(ES)"});
    DefaultTableModel tablaClientes2 = new DefaultTableModel(null, new String[]{"ID","NOMBRE","APELLIDOS"});
    DefaultTableModel tablaHabitaciones = new DefaultTableModel(null, new String[]{"ID", "TIPO"});
    DefaultTableModel tablaIngresos = new DefaultTableModel(null, new String[]{"",""});
    DefaultTableModel tablaRentas = new DefaultTableModel(null, new String[]{"",""});
    DefaultTableModel tablaCuenta = new DefaultTableModel(null, new String[]{"",""});

    ArrayList<Usuario> usuarios;
    ArrayList<Cliente> clientes;
    ArrayList<Paquete> paquetes;
    ArrayList<Servicio> servicios;
    ArrayList<Reserva> reservas;
    ArrayList<Habitacion> habitacionesDisponibles;
    ArrayList<Habitacion> habitacionesReservadas;
    ArrayList<Venta> ingresos;
    ArrayList<Renta> rentas;
    ArrayList<Venta> cuenta;

    ListSelectionModel lsmUsuarios;
    ListSelectionModel lsmClientes;
    ListSelectionModel lsmPaquetes;
    ListSelectionModel lsmServicios;
    ListSelectionModel lsmReservas;
    ListSelectionModel lsmHabitacionesDisponibles;
    ListSelectionModel lsmHabitacionesReservadas;
    ListSelectionModel lsmIngresos;
    ListSelectionModel lsmRentas;
    ListSelectionModel lsmCuenta;


    /** Creates new form JTAgendaContactos */
    public SAR() {
        initComponents();
        PanelPrincipal.setVisible(false);
        txtInfoTrabajador.setVisible(false);
        btnSalir.setVisible(false);
        deshabilitaDatos();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        PanelPrincipal = new javax.swing.JTabbedPane();
        jPanel1 = new javax.swing.JPanel();
        txtBuscarUsuario = new javax.swing.JTextField();
        btnBuscarUsuario = new javax.swing.JButton();
        jPanelDatosUsuario = new javax.swing.JPanel();
        lblidUsuario = new javax.swing.JLabel();
        lblNombreUsuario = new javax.swing.JLabel();
        lblApellidosUsuario = new javax.swing.JLabel();
        lblDireccionUsuario = new javax.swing.JLabel();
        lblAdministradorUsuario = new javax.swing.JLabel();
        lblContrasenaUsuario = new javax.swing.JLabel();
        txtidUsuario = new javax.swing.JTextField();
        txtNombreUsuario = new javax.swing.JTextField();
        txtApellidosUsuario = new javax.swing.JTextField();
        txtDireccionUsuario = new javax.swing.JTextField();
        txtContrasenaUsuario = new javax.swing.JTextField();
        checkAdministrador = new javax.swing.JCheckBox();
        jPanelBotonesUsuario = new javax.swing.JPanel();
        btnNuevoUsuario = new javax.swing.JButton();
        btnEliminarUsuario = new javax.swing.JButton();
        btnGuardarUsuario = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        tableUsuario = new javax.swing.JTable();
        jPanel2 = new javax.swing.JPanel();
        txtBuscarCliente = new javax.swing.JTextField();
        btnBuscarCliente = new javax.swing.JButton();
        jPanelDatosCliente = new javax.swing.JPanel();
        lblidCliente = new javax.swing.JLabel();
        lblNombreCliente = new javax.swing.JLabel();
        lblApellidosCliente = new javax.swing.JLabel();
        lblDireccionCliente = new javax.swing.JLabel();
        lblTelefonoCliente = new javax.swing.JLabel();
        lblHuesped = new javax.swing.JLabel();
        txtidCliente = new javax.swing.JTextField();
        txtNombreCliente = new javax.swing.JTextField();
        txtApellidosCliente = new javax.swing.JTextField();
        txtDireccionCliente = new javax.swing.JTextField();
        txtTelefonoCliente = new javax.swing.JTextField();
        checkCliente = new javax.swing.JCheckBox();
        jPanelBotonesCliente = new javax.swing.JPanel();
        btnNuevoCliente = new javax.swing.JButton();
        btnEliminarCliente = new javax.swing.JButton();
        btnGuardarCliente = new javax.swing.JButton();
        jScrollPane2 = new javax.swing.JScrollPane();
        tableCliente = new javax.swing.JTable();
        jPanel3 = new javax.swing.JPanel();
        txtBuscarPaquete = new javax.swing.JTextField();
        btnBuscarPaquete = new javax.swing.JButton();
        jPanelDatosPaquete = new javax.swing.JPanel();
        lblidPaquete = new javax.swing.JLabel();
        lblNombrePaquete = new javax.swing.JLabel();
        lblDescripcionPaquete = new javax.swing.JLabel();
        lblPrecioPaquete = new javax.swing.JLabel();
        txtidPaquete = new javax.swing.JTextField();
        txtNombrePaquete = new javax.swing.JTextField();
        txtDescripcionPaquete = new javax.swing.JTextField();
        txtPrecioPaquete = new javax.swing.JTextField();
        jScrollPane12 = new javax.swing.JScrollPane();
        tableServicios2 = new javax.swing.JTable();
        btnAgregarHabitacion1 = new javax.swing.JButton();
        jScrollPane13 = new javax.swing.JScrollPane();
        tableServiciosEscogidos = new javax.swing.JTable();
        jPanelBotonesPaquete = new javax.swing.JPanel();
        btnNuevoPaquete = new javax.swing.JButton();
        btnModificarPaquete = new javax.swing.JButton();
        btnEliminarPaquete = new javax.swing.JButton();
        btnGuardarPaquete = new javax.swing.JButton();
        jScrollPane3 = new javax.swing.JScrollPane();
        tablePaquete = new javax.swing.JTable();
        jScrollPane14 = new javax.swing.JScrollPane();
        tableServicios = new javax.swing.JTable();
        jScrollPane15 = new javax.swing.JScrollPane();
        tablePaquetes = new javax.swing.JTable();
        jPanel4 = new javax.swing.JPanel();
        txtBuscarServicio = new javax.swing.JTextField();
        btnBuscarServicio = new javax.swing.JButton();
        jPanelDatosServicio = new javax.swing.JPanel();
        lblidServicio = new javax.swing.JLabel();
        lblNombreServicio = new javax.swing.JLabel();
        lblPrecioServicio = new javax.swing.JLabel();
        txtidServicio = new javax.swing.JTextField();
        txtNombreServicio = new javax.swing.JTextField();
        txtPrecioServicio = new javax.swing.JTextField();
        jPanelBotonesServicio = new javax.swing.JPanel();
        btnNuevoServicio = new javax.swing.JButton();
        btnModificarServicio = new javax.swing.JButton();
        btnEliminarServicio = new javax.swing.JButton();
        btnGuardarServicio = new javax.swing.JButton();
        jScrollPane4 = new javax.swing.JScrollPane();
        tableServicio = new javax.swing.JTable();
        jPanel5 = new javax.swing.JPanel();
        btnBuscarReserva = new javax.swing.JButton();
        txtBuscarReserva = new javax.swing.JTextField();
        jPanelDatosReserva = new javax.swing.JPanel();
        lblidReserva = new javax.swing.JLabel();
        lblFechaInicio = new javax.swing.JLabel();
        lblFechaFin = new javax.swing.JLabel();
        lblFecha = new javax.swing.JLabel();
        lblHabitacionesDisponibles = new javax.swing.JLabel();
        txtidReserva = new javax.swing.JTextField();
        txtFechaInicio = new javax.swing.JTextField();
        txtFechaFin = new javax.swing.JTextField();
        txtFecha = new javax.swing.JTextField();
        jScrollPane6 = new javax.swing.JScrollPane();
        tableHabitacionesDisponibles = new javax.swing.JTable();
        jScrollPane7 = new javax.swing.JScrollPane();
        tableHabitacionesReservadas = new javax.swing.JTable();
        btnAgregarHabitacion = new javax.swing.JButton();
        lblCliente = new javax.swing.JLabel();
        jScrollPane8 = new javax.swing.JScrollPane();
        tableClientesRegistrados = new javax.swing.JTable();
        jPanelBotonesReserva = new javax.swing.JPanel();
        btnNuevoReserva = new javax.swing.JButton();
        btnEliminarReserva = new javax.swing.JButton();
        btnGuardarReserva = new javax.swing.JButton();
        jScrollPane5 = new javax.swing.JScrollPane();
        tableReserva = new javax.swing.JTable();
        jPanel6 = new javax.swing.JPanel();
        jPanelDatosCuenta = new javax.swing.JPanel();
        jScrollPane11 = new javax.swing.JScrollPane();
        tableCuenta = new javax.swing.JTable();
        btnMostrar = new javax.swing.JButton();
        btnPagar = new javax.swing.JButton();
        jPanelDatosIngresos = new javax.swing.JPanel();
        lblFechaInicioIngresos = new javax.swing.JLabel();
        txtFechaInicioIngresos = new javax.swing.JTextField();
        lblFechaFinIngresos = new javax.swing.JLabel();
        txtFechaFinIngresos = new javax.swing.JTextField();
        btnVerIngresos = new javax.swing.JButton();
        jScrollPane9 = new javax.swing.JScrollPane();
        tableIngresos = new javax.swing.JTable();
        lblTotal = new javax.swing.JLabel();
        txtTotal = new javax.swing.JTextField();
        jPanel7 = new javax.swing.JPanel();
        txtBuscarRenta = new javax.swing.JTextField();
        btnBuscarRenta = new javax.swing.JButton();
        jPanelDatosReserva1 = new javax.swing.JPanel();
        lblidReserva1 = new javax.swing.JLabel();
        lblFechaInicio1 = new javax.swing.JLabel();
        lblFechaFin1 = new javax.swing.JLabel();
        lblHabitacionesDisponibles1 = new javax.swing.JLabel();
        txtidReserva1 = new javax.swing.JTextField();
        txtFechaInicio1 = new javax.swing.JTextField();
        txtFechaFin1 = new javax.swing.JTextField();
        jScrollPane10 = new javax.swing.JScrollPane();
        tableHabitacionesDisponibles1 = new javax.swing.JTable();
        jScrollPane16 = new javax.swing.JScrollPane();
        tableHabitacionesReservadas1 = new javax.swing.JTable();
        btnAgregarHabitacion2 = new javax.swing.JButton();
        lblCliente1 = new javax.swing.JLabel();
        jScrollPane17 = new javax.swing.JScrollPane();
        tableClientesRegistrados1 = new javax.swing.JTable();
        jPanelBotonesReserva1 = new javax.swing.JPanel();
        btnNuevoReserva1 = new javax.swing.JButton();
        btnEliminarReserva1 = new javax.swing.JButton();
        btnGuardarReserva1 = new javax.swing.JButton();
        jScrollPane18 = new javax.swing.JScrollPane();
        tableReserva1 = new javax.swing.JTable();
        btnSalir = new javax.swing.JButton();
        txtInfoTrabajador = new javax.swing.JTextField();
        lblUsuario = new javax.swing.JLabel();
        lblContrasena = new javax.swing.JLabel();
        txtUsuario = new javax.swing.JTextField();
        txtContrasena = new javax.swing.JPasswordField();
        btnEntrar = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setResizable(false);

        PanelPrincipal.setFont(new java.awt.Font("Trebuchet MS", 0, 14));

        txtBuscarUsuario.setFont(new java.awt.Font("Trebuchet MS", 0, 14));

        btnBuscarUsuario.setFont(new java.awt.Font("Trebuchet MS", 1, 14));
        btnBuscarUsuario.setText("Buscar");
        btnBuscarUsuario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnBuscarUsuarioActionPerformed(evt);
            }
        });

        jPanelDatosUsuario.setBorder(javax.swing.BorderFactory.createTitledBorder("Datos de Contacto"));
        jPanelDatosUsuario.setFont(new java.awt.Font("Trebuchet MS", 0, 14));

        lblidUsuario.setFont(new java.awt.Font("Trebuchet MS", 0, 14));
        lblidUsuario.setText("Id");

        lblNombreUsuario.setFont(new java.awt.Font("Trebuchet MS", 0, 14));
        lblNombreUsuario.setText("Nombre");

        lblApellidosUsuario.setFont(new java.awt.Font("Trebuchet MS", 0, 14));
        lblApellidosUsuario.setText("Apellidos");

        lblDireccionUsuario.setFont(new java.awt.Font("Trebuchet MS", 0, 14));
        lblDireccionUsuario.setText("Dirección");

        lblAdministradorUsuario.setFont(new java.awt.Font("Trebuchet MS", 0, 14));
        lblAdministradorUsuario.setText("¿Administrador?");

        lblContrasenaUsuario.setFont(new java.awt.Font("Trebuchet MS", 0, 14));
        lblContrasenaUsuario.setText("Contraseña");

        txtidUsuario.setFont(new java.awt.Font("Trebuchet MS", 0, 14));

        txtNombreUsuario.setFont(new java.awt.Font("Trebuchet MS", 0, 14));

        txtApellidosUsuario.setFont(new java.awt.Font("Trebuchet MS", 0, 14));

        txtDireccionUsuario.setFont(new java.awt.Font("Trebuchet MS", 0, 14));

        txtContrasenaUsuario.setFont(new java.awt.Font("Trebuchet MS", 0, 14));
        txtContrasenaUsuario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtContrasenaUsuarioActionPerformed(evt);
            }
        });

        checkAdministrador.setFont(new java.awt.Font("Trebuchet MS", 0, 14));
        checkAdministrador.setText("Sí");
        checkAdministrador.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                checkAdministradorActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanelDatosUsuarioLayout = new javax.swing.GroupLayout(jPanelDatosUsuario);
        jPanelDatosUsuario.setLayout(jPanelDatosUsuarioLayout);
        jPanelDatosUsuarioLayout.setHorizontalGroup(
            jPanelDatosUsuarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelDatosUsuarioLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelDatosUsuarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblNombreUsuario)
                    .addComponent(lblApellidosUsuario)
                    .addComponent(lblidUsuario))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelDatosUsuarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(txtidUsuario, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtApellidosUsuario, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 94, Short.MAX_VALUE)
                    .addComponent(txtNombreUsuario, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 94, Short.MAX_VALUE))
                .addGap(18, 18, 18)
                .addGroup(jPanelDatosUsuarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblContrasenaUsuario)
                    .addComponent(lblDireccionUsuario)
                    .addComponent(lblAdministradorUsuario))
                .addGap(41, 41, 41)
                .addGroup(jPanelDatosUsuarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(txtDireccionUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, 215, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(checkAdministrador)
                    .addComponent(txtContrasenaUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, 165, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );
        jPanelDatosUsuarioLayout.setVerticalGroup(
            jPanelDatosUsuarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelDatosUsuarioLayout.createSequentialGroup()
                .addGroup(jPanelDatosUsuarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelDatosUsuarioLayout.createSequentialGroup()
                        .addGap(22, 22, 22)
                        .addGroup(jPanelDatosUsuarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(lblidUsuario)
                            .addComponent(txtidUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanelDatosUsuarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(lblNombreUsuario)
                            .addGroup(jPanelDatosUsuarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(txtNombreUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(lblAdministradorUsuario)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanelDatosUsuarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lblApellidosUsuario)
                            .addComponent(txtApellidosUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanelDatosUsuarioLayout.createSequentialGroup()
                        .addGap(17, 17, 17)
                        .addGroup(jPanelDatosUsuarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(lblDireccionUsuario)
                            .addComponent(txtDireccionUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(checkAdministrador)
                        .addGap(8, 8, 8)
                        .addGroup(jPanelDatosUsuarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lblContrasenaUsuario)
                            .addComponent(txtContrasenaUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap(30, Short.MAX_VALUE))
        );

        btnNuevoUsuario.setFont(new java.awt.Font("Trebuchet MS", 1, 14));
        btnNuevoUsuario.setText("Nuevo");
        btnNuevoUsuario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnNuevoUsuarioActionPerformed(evt);
            }
        });

        btnEliminarUsuario.setFont(new java.awt.Font("Trebuchet MS", 1, 14));
        btnEliminarUsuario.setText("Eliminar");
        btnEliminarUsuario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnEliminarUsuarioActionPerformed(evt);
            }
        });

        btnGuardarUsuario.setFont(new java.awt.Font("Trebuchet MS", 1, 14));
        btnGuardarUsuario.setText("Guardar");
        btnGuardarUsuario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnGuardarUsuarioActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanelBotonesUsuarioLayout = new javax.swing.GroupLayout(jPanelBotonesUsuario);
        jPanelBotonesUsuario.setLayout(jPanelBotonesUsuarioLayout);
        jPanelBotonesUsuarioLayout.setHorizontalGroup(
            jPanelBotonesUsuarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelBotonesUsuarioLayout.createSequentialGroup()
                .addGap(86, 86, 86)
                .addComponent(btnNuevoUsuario)
                .addGap(84, 84, 84)
                .addComponent(btnEliminarUsuario)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 77, Short.MAX_VALUE)
                .addComponent(btnGuardarUsuario)
                .addGap(72, 72, 72))
        );
        jPanelBotonesUsuarioLayout.setVerticalGroup(
            jPanelBotonesUsuarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelBotonesUsuarioLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelBotonesUsuarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnNuevoUsuario)
                    .addComponent(btnEliminarUsuario)
                    .addComponent(btnGuardarUsuario))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        tableUsuario.setFont(new java.awt.Font("Calibri", 0, 14));
        tableUsuario.setModel(tablaUsuarios);
        tableUsuario.setSurrendersFocusOnKeystroke(true);
        tableUsuario.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        lsmUsuarios = tableUsuario.getSelectionModel();
        lsmUsuarios.addListSelectionListener(new ListSelectionListener(){
            public void valueChanged(ListSelectionEvent e){
                if(! e.getValueIsAdjusting()){
                    tablaLineaSeleccionadaUsuario(tableUsuario);
                }
            }

        });
        jScrollPane1.setViewportView(tableUsuario);

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 569, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addComponent(jPanelBotonesUsuario, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jPanelDatosUsuario, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
                            .addComponent(txtBuscarUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, 435, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(29, 29, 29)
                            .addComponent(btnBuscarUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap(239, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(22, 22, 22)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtBuscarUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnBuscarUsuario))
                .addGap(18, 18, 18)
                .addComponent(jPanelDatosUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanelBotonesUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 148, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(103, Short.MAX_VALUE))
        );

        jPanelDatosUsuario.getAccessibleContext().setAccessibleName("Datos del Usuario");

        PanelPrincipal.addTab("Usuarios", jPanel1);

        txtBuscarCliente.setFont(new java.awt.Font("Trebuchet MS", 0, 14));

        btnBuscarCliente.setFont(new java.awt.Font("Trebuchet MS", 1, 14));
        btnBuscarCliente.setText("Buscar");
        btnBuscarCliente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnBuscarClienteActionPerformed(evt);
            }
        });

        jPanelDatosCliente.setBorder(javax.swing.BorderFactory.createTitledBorder("Datos de Contacto"));
        jPanelDatosCliente.setFont(new java.awt.Font("Trebuchet MS", 0, 14));

        lblidCliente.setFont(new java.awt.Font("Trebuchet MS", 0, 14));
        lblidCliente.setText("Id");

        lblNombreCliente.setFont(new java.awt.Font("Trebuchet MS", 0, 14));
        lblNombreCliente.setText("Nombre");

        lblApellidosCliente.setFont(new java.awt.Font("Trebuchet MS", 0, 14));
        lblApellidosCliente.setText("Apellidos");

        lblDireccionCliente.setFont(new java.awt.Font("Trebuchet MS", 0, 14));
        lblDireccionCliente.setText("Dirección");

        lblTelefonoCliente.setFont(new java.awt.Font("Trebuchet MS", 0, 14));
        lblTelefonoCliente.setText("Teléfono");

        lblHuesped.setFont(new java.awt.Font("Trebuchet MS", 0, 14));
        lblHuesped.setText("¿Huesped?");

        txtidCliente.setFont(new java.awt.Font("Trebuchet MS", 0, 14));

        txtNombreCliente.setFont(new java.awt.Font("Trebuchet MS", 0, 14));

        txtApellidosCliente.setFont(new java.awt.Font("Trebuchet MS", 0, 14));

        txtDireccionCliente.setFont(new java.awt.Font("Trebuchet MS", 0, 14));

        txtTelefonoCliente.setFont(new java.awt.Font("Trebuchet MS", 0, 14));

        checkCliente.setFont(new java.awt.Font("Trebuchet MS", 0, 14));
        checkCliente.setText("Sí");
        checkCliente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                checkClienteActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanelDatosClienteLayout = new javax.swing.GroupLayout(jPanelDatosCliente);
        jPanelDatosCliente.setLayout(jPanelDatosClienteLayout);
        jPanelDatosClienteLayout.setHorizontalGroup(
            jPanelDatosClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelDatosClienteLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelDatosClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblNombreCliente)
                    .addComponent(lblApellidosCliente)
                    .addComponent(lblidCliente))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelDatosClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(txtidCliente, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtApellidosCliente, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 152, Short.MAX_VALUE)
                    .addComponent(txtNombreCliente, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 152, Short.MAX_VALUE))
                .addGap(18, 18, 18)
                .addGroup(jPanelDatosClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblHuesped)
                    .addComponent(lblDireccionCliente)
                    .addComponent(lblTelefonoCliente))
                .addGap(41, 41, 41)
                .addGroup(jPanelDatosClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(txtDireccionCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 215, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtTelefonoCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 182, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(checkCliente))
                .addContainerGap())
        );
        jPanelDatosClienteLayout.setVerticalGroup(
            jPanelDatosClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelDatosClienteLayout.createSequentialGroup()
                .addGroup(jPanelDatosClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelDatosClienteLayout.createSequentialGroup()
                        .addGap(22, 22, 22)
                        .addGroup(jPanelDatosClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(lblidCliente)
                            .addComponent(txtidCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanelDatosClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(lblNombreCliente)
                            .addGroup(jPanelDatosClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(txtNombreCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(lblTelefonoCliente)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanelDatosClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lblApellidosCliente)
                            .addComponent(txtApellidosCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanelDatosClienteLayout.createSequentialGroup()
                        .addGap(17, 17, 17)
                        .addGroup(jPanelDatosClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(lblDireccionCliente)
                            .addComponent(txtDireccionCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(txtTelefonoCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(12, 12, 12)
                        .addGroup(jPanelDatosClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lblHuesped)
                            .addComponent(checkCliente))))
                .addContainerGap(30, Short.MAX_VALUE))
        );

        btnNuevoCliente.setFont(new java.awt.Font("Trebuchet MS", 1, 14));
        btnNuevoCliente.setText("Nuevo");
        btnNuevoCliente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnNuevoClienteActionPerformed(evt);
            }
        });

        btnEliminarCliente.setFont(new java.awt.Font("Trebuchet MS", 1, 14));
        btnEliminarCliente.setText("Eliminar");
        btnEliminarCliente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnEliminarClienteActionPerformed(evt);
            }
        });

        btnGuardarCliente.setFont(new java.awt.Font("Trebuchet MS", 1, 14));
        btnGuardarCliente.setText("Guardar");
        btnGuardarCliente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnGuardarClienteActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanelBotonesClienteLayout = new javax.swing.GroupLayout(jPanelBotonesCliente);
        jPanelBotonesCliente.setLayout(jPanelBotonesClienteLayout);
        jPanelBotonesClienteLayout.setHorizontalGroup(
            jPanelBotonesClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelBotonesClienteLayout.createSequentialGroup()
                .addGap(202, 202, 202)
                .addComponent(btnNuevoCliente)
                .addGap(56, 56, 56)
                .addComponent(btnEliminarCliente)
                .addGap(46, 46, 46)
                .addComponent(btnGuardarCliente)
                .addContainerGap(39, Short.MAX_VALUE))
        );
        jPanelBotonesClienteLayout.setVerticalGroup(
            jPanelBotonesClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelBotonesClienteLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelBotonesClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnNuevoCliente)
                    .addComponent(btnEliminarCliente)
                    .addComponent(btnGuardarCliente))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        tableCliente.setFont(new java.awt.Font("Calibri", 0, 14));
        tableCliente.setModel(tablaClientes);
        tableUsuario.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        lsmClientes = tableCliente.getSelectionModel();
        lsmClientes.addListSelectionListener(new ListSelectionListener(){
            public void valueChanged(ListSelectionEvent e){
                if(! e.getValueIsAdjusting()){
                    tablaLineaSeleccionadaCliente(tableCliente);
                }
            }

        });
        jScrollPane2.setViewportView(tableCliente);

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanelBotonesCliente, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanelDatosCliente, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel2Layout.createSequentialGroup()
                        .addComponent(txtBuscarCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 435, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(29, 29, 29)
                        .addComponent(btnBuscarCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(224, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGap(22, 22, 22)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtBuscarCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnBuscarCliente))
                .addGap(18, 18, 18)
                .addComponent(jPanelDatosCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanelBotonesCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(123, Short.MAX_VALUE))
        );

        jPanelDatosCliente.getAccessibleContext().setAccessibleName("Datos del Cliente");

        PanelPrincipal.addTab("Clientes", jPanel2);

        txtBuscarPaquete.setFont(new java.awt.Font("Trebuchet MS", 0, 14));

        btnBuscarPaquete.setFont(new java.awt.Font("Trebuchet MS", 1, 14));
        btnBuscarPaquete.setText("Buscar");
        btnBuscarPaquete.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnBuscarPaqueteActionPerformed(evt);
            }
        });

        jPanelDatosPaquete.setBorder(javax.swing.BorderFactory.createTitledBorder("Datos de Contacto"));
        jPanelDatosPaquete.setFont(new java.awt.Font("Trebuchet MS", 0, 14));

        lblidPaquete.setFont(new java.awt.Font("Trebuchet MS", 0, 14));
        lblidPaquete.setText("Id");

        lblNombrePaquete.setFont(new java.awt.Font("Trebuchet MS", 0, 14));
        lblNombrePaquete.setText("Nombre");

        lblDescripcionPaquete.setFont(new java.awt.Font("Trebuchet MS", 0, 14));
        lblDescripcionPaquete.setText("Descripción");

        lblPrecioPaquete.setFont(new java.awt.Font("Trebuchet MS", 0, 14));
        lblPrecioPaquete.setText("Precio");

        txtidPaquete.setFont(new java.awt.Font("Trebuchet MS", 0, 14));

        txtNombrePaquete.setFont(new java.awt.Font("Trebuchet MS", 0, 14));

        txtDescripcionPaquete.setFont(new java.awt.Font("Trebuchet MS", 0, 14));

        txtPrecioPaquete.setFont(new java.awt.Font("Trebuchet MS", 0, 14));
        txtPrecioPaquete.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtPrecioPaqueteActionPerformed(evt);
            }
        });

        tableServicios2.setFont(new java.awt.Font("Calibri", 0, 14));
        tableServicios2.setModel(tablaServicios2);
        tableUsuario.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        lsmHabitacionesDisponibles = tableHabitacionesDisponibles.getSelectionModel();
        lsmHabitacionesDisponibles.addListSelectionListener(new ListSelectionListener(){
            public void valueChanged(ListSelectionEvent e){
                if(! e.getValueIsAdjusting()){
                    tablaLineaSeleccionadaServicio(tableHabitacionesDisponibles);
                }
            }

        });
        jScrollPane12.setViewportView(tableServicios2);

        btnAgregarHabitacion1.setFont(new java.awt.Font("Trebuchet MS", 1, 14));
        btnAgregarHabitacion1.setText("Agregar");

        tableServiciosEscogidos.setFont(new java.awt.Font("Calibri", 0, 14));
        tableServiciosEscogidos.setModel(tablaServiciosEscogidos);
        tableUsuario.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        lsmHabitacionesReservadas = tableHabitacionesReservadas.getSelectionModel();
        lsmHabitacionesReservadas.addListSelectionListener(new ListSelectionListener(){
            public void valueChanged(ListSelectionEvent e){
                if(! e.getValueIsAdjusting()){
                    tablaLineaSeleccionadaServicio(tableHabitacionesReservadas);
                }
            }

        });
        jScrollPane13.setViewportView(tableServiciosEscogidos);

        javax.swing.GroupLayout jPanelDatosPaqueteLayout = new javax.swing.GroupLayout(jPanelDatosPaquete);
        jPanelDatosPaquete.setLayout(jPanelDatosPaqueteLayout);
        jPanelDatosPaqueteLayout.setHorizontalGroup(
            jPanelDatosPaqueteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelDatosPaqueteLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelDatosPaqueteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblNombrePaquete)
                    .addComponent(lblDescripcionPaquete)
                    .addComponent(lblidPaquete)
                    .addComponent(lblPrecioPaquete))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelDatosPaqueteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelDatosPaqueteLayout.createSequentialGroup()
                        .addGroup(jPanelDatosPaqueteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(txtidPaquete, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtDescripcionPaquete, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 125, Short.MAX_VALUE)
                            .addComponent(txtNombrePaquete, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 125, Short.MAX_VALUE))
                        .addGap(43, 43, 43))
                    .addGroup(jPanelDatosPaqueteLayout.createSequentialGroup()
                        .addComponent(txtPrecioPaquete, javax.swing.GroupLayout.PREFERRED_SIZE, 108, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 17, Short.MAX_VALUE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane12, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(btnAgregarHabitacion1)
                .addGap(18, 18, 18)
                .addComponent(jScrollPane13, javax.swing.GroupLayout.PREFERRED_SIZE, 149, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(33, 33, 33))
        );
        jPanelDatosPaqueteLayout.setVerticalGroup(
            jPanelDatosPaqueteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelDatosPaqueteLayout.createSequentialGroup()
                .addGroup(jPanelDatosPaqueteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelDatosPaqueteLayout.createSequentialGroup()
                        .addGap(54, 54, 54)
                        .addGroup(jPanelDatosPaqueteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(lblidPaquete)
                            .addComponent(txtidPaquete, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanelDatosPaqueteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(lblNombrePaquete)
                            .addComponent(txtNombrePaquete, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanelDatosPaqueteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lblDescripcionPaquete)
                            .addComponent(txtDescripcionPaquete, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanelDatosPaqueteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(lblPrecioPaquete)
                            .addComponent(txtPrecioPaquete, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanelDatosPaqueteLayout.createSequentialGroup()
                        .addGap(58, 58, 58)
                        .addComponent(btnAgregarHabitacion1))
                    .addGroup(jPanelDatosPaqueteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addComponent(jScrollPane13, javax.swing.GroupLayout.Alignment.LEADING, 0, 0, Short.MAX_VALUE)
                        .addComponent(jScrollPane12, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 149, Short.MAX_VALUE)))
                .addContainerGap())
        );

        btnNuevoPaquete.setFont(new java.awt.Font("Trebuchet MS", 1, 14));
        btnNuevoPaquete.setText("Nuevo");
        btnNuevoPaquete.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnNuevoPaqueteActionPerformed(evt);
            }
        });

        btnModificarPaquete.setFont(new java.awt.Font("Trebuchet MS", 1, 14));
        btnModificarPaquete.setText("Modificar");
        btnModificarPaquete.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnModificarPaqueteActionPerformed(evt);
            }
        });

        btnEliminarPaquete.setFont(new java.awt.Font("Trebuchet MS", 1, 14));
        btnEliminarPaquete.setText("Eliminar");
        btnEliminarPaquete.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnEliminarPaqueteActionPerformed(evt);
            }
        });

        btnGuardarPaquete.setFont(new java.awt.Font("Trebuchet MS", 1, 14));
        btnGuardarPaquete.setText("Guardar");
        btnGuardarPaquete.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnGuardarPaqueteActionPerformed(evt);
            }
        });

        tablePaquete.setFont(new java.awt.Font("Calibri", 0, 14));
        tablePaquete.setModel(tablaPaquetes);
        tableUsuario.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        lsmPaquetes = tablePaquete.getSelectionModel();
        lsmPaquetes.addListSelectionListener(new ListSelectionListener(){
            public void valueChanged(ListSelectionEvent e){
                if(! e.getValueIsAdjusting()){
                    tablaLineaSeleccionadaPaquete(tablePaquete);
                }
            }

        });
        jScrollPane3.setViewportView(tablePaquete);

        tableServicios.setFont(new java.awt.Font("Calibri", 0, 14));
        tableServicios.setModel(tablaServicios2);
        tableUsuario.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        lsmHabitacionesDisponibles = tableHabitacionesDisponibles.getSelectionModel();
        lsmHabitacionesDisponibles.addListSelectionListener(new ListSelectionListener(){
            public void valueChanged(ListSelectionEvent e){
                if(! e.getValueIsAdjusting()){
                    tablaLineaSeleccionadaPaquete(tableHabitacionesDisponibles);
                }
            }

        });
        jScrollPane14.setViewportView(tableServicios);

        javax.swing.GroupLayout jPanelBotonesPaqueteLayout = new javax.swing.GroupLayout(jPanelBotonesPaquete);
        jPanelBotonesPaquete.setLayout(jPanelBotonesPaqueteLayout);
        jPanelBotonesPaqueteLayout.setHorizontalGroup(
            jPanelBotonesPaqueteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelBotonesPaqueteLayout.createSequentialGroup()
                .addGroup(jPanelBotonesPaqueteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelBotonesPaqueteLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(btnNuevoPaquete)
                        .addGap(18, 18, 18)
                        .addComponent(btnModificarPaquete)
                        .addGap(18, 18, 18)
                        .addComponent(btnEliminarPaquete)
                        .addGap(18, 18, 18)
                        .addComponent(btnGuardarPaquete))
                    .addGroup(jPanelBotonesPaqueteLayout.createSequentialGroup()
                        .addComponent(jScrollPane14, javax.swing.GroupLayout.PREFERRED_SIZE, 776, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 645, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanelBotonesPaqueteLayout.setVerticalGroup(
            jPanelBotonesPaqueteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelBotonesPaqueteLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanelBotonesPaqueteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnNuevoPaquete)
                    .addComponent(btnModificarPaquete)
                    .addComponent(btnEliminarPaquete)
                    .addComponent(btnGuardarPaquete))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelBotonesPaqueteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane14, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 118, javax.swing.GroupLayout.PREFERRED_SIZE)))
        );

        tablePaquetes.setFont(new java.awt.Font("Calibri", 0, 14));
        tablePaquetes.setModel(tablaPaquetes);
        tableUsuario.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        lsmHabitacionesDisponibles = tableHabitacionesDisponibles.getSelectionModel();
        lsmHabitacionesDisponibles.addListSelectionListener(new ListSelectionListener(){
            public void valueChanged(ListSelectionEvent e){
                if(! e.getValueIsAdjusting()){
                    tablaLineaSeleccionadaPaquete(tableHabitacionesDisponibles);
                }
            }

        });
        jScrollPane15.setViewportView(tablePaquetes);

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addComponent(jScrollPane15, javax.swing.GroupLayout.PREFERRED_SIZE, 691, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(txtBuscarPaquete, javax.swing.GroupLayout.PREFERRED_SIZE, 435, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(29, 29, 29)
                        .addComponent(btnBuscarPaquete, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addComponent(jPanelBotonesPaquete, javax.swing.GroupLayout.Alignment.LEADING, 0, 719, Short.MAX_VALUE)
                        .addComponent(jPanelDatosPaquete, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addContainerGap(89, Short.MAX_VALUE))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGap(22, 22, 22)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtBuscarPaquete, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnBuscarPaquete))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanelDatosPaquete, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanelBotonesPaquete, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane15, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(116, Short.MAX_VALUE))
        );

        PanelPrincipal.addTab("Paquetes", jPanel3);

        txtBuscarServicio.setFont(new java.awt.Font("Trebuchet MS", 0, 14));

        btnBuscarServicio.setFont(new java.awt.Font("Trebuchet MS", 1, 14));
        btnBuscarServicio.setText("Buscar");
        btnBuscarServicio.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnBuscarServicioActionPerformed(evt);
            }
        });

        jPanelDatosServicio.setBorder(javax.swing.BorderFactory.createTitledBorder("Datos de Contacto"));
        jPanelDatosServicio.setFont(new java.awt.Font("Trebuchet MS", 0, 14));

        lblidServicio.setFont(new java.awt.Font("Trebuchet MS", 0, 14));
        lblidServicio.setText("Id");

        lblNombreServicio.setFont(new java.awt.Font("Trebuchet MS", 0, 14));
        lblNombreServicio.setText("Nombre");

        lblPrecioServicio.setFont(new java.awt.Font("Trebuchet MS", 0, 14));
        lblPrecioServicio.setText("Precio");

        txtidServicio.setFont(new java.awt.Font("Trebuchet MS", 0, 14));

        txtNombreServicio.setFont(new java.awt.Font("Trebuchet MS", 0, 14));

        txtPrecioServicio.setFont(new java.awt.Font("Trebuchet MS", 0, 14));

        javax.swing.GroupLayout jPanelDatosServicioLayout = new javax.swing.GroupLayout(jPanelDatosServicio);
        jPanelDatosServicio.setLayout(jPanelDatosServicioLayout);
        jPanelDatosServicioLayout.setHorizontalGroup(
            jPanelDatosServicioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelDatosServicioLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelDatosServicioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblNombreServicio)
                    .addComponent(lblPrecioServicio)
                    .addComponent(lblidServicio))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelDatosServicioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(txtidServicio, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtPrecioServicio, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 152, Short.MAX_VALUE)
                    .addComponent(txtNombreServicio, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 152, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanelDatosServicioLayout.setVerticalGroup(
            jPanelDatosServicioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelDatosServicioLayout.createSequentialGroup()
                .addGap(22, 22, 22)
                .addGroup(jPanelDatosServicioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(lblidServicio)
                    .addComponent(txtidServicio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelDatosServicioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(lblNombreServicio)
                    .addComponent(txtNombreServicio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelDatosServicioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblPrecioServicio)
                    .addComponent(txtPrecioServicio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(30, Short.MAX_VALUE))
        );

        btnNuevoServicio.setFont(new java.awt.Font("Trebuchet MS", 1, 14));
        btnNuevoServicio.setText("Nuevo");
        btnNuevoServicio.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnNuevoServicioActionPerformed(evt);
            }
        });

        btnModificarServicio.setFont(new java.awt.Font("Trebuchet MS", 1, 14));
        btnModificarServicio.setText("Modificar");
        btnModificarServicio.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnModificarServicioActionPerformed(evt);
            }
        });

        btnEliminarServicio.setFont(new java.awt.Font("Trebuchet MS", 1, 14));
        btnEliminarServicio.setText("Eliminar");
        btnEliminarServicio.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnEliminarServicioActionPerformed(evt);
            }
        });

        btnGuardarServicio.setFont(new java.awt.Font("Trebuchet MS", 1, 14));
        btnGuardarServicio.setText("Guardar");
        btnGuardarServicio.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnGuardarServicioActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanelBotonesServicioLayout = new javax.swing.GroupLayout(jPanelBotonesServicio);
        jPanelBotonesServicio.setLayout(jPanelBotonesServicioLayout);
        jPanelBotonesServicioLayout.setHorizontalGroup(
            jPanelBotonesServicioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelBotonesServicioLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(btnNuevoServicio)
                .addGap(18, 18, 18)
                .addComponent(btnModificarServicio)
                .addGap(18, 18, 18)
                .addComponent(btnEliminarServicio)
                .addGap(18, 18, 18)
                .addComponent(btnGuardarServicio)
                .addContainerGap(32, Short.MAX_VALUE))
        );
        jPanelBotonesServicioLayout.setVerticalGroup(
            jPanelBotonesServicioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelBotonesServicioLayout.createSequentialGroup()
                .addGap(49, 49, 49)
                .addGroup(jPanelBotonesServicioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnNuevoServicio)
                    .addComponent(btnModificarServicio)
                    .addComponent(btnEliminarServicio)
                    .addComponent(btnGuardarServicio))
                .addContainerGap(78, Short.MAX_VALUE))
        );

        tableServicio.setFont(new java.awt.Font("Calibri", 0, 14));
        tableServicio.setModel(tablaServicios);
        tableUsuario.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        lsmServicios = tableServicio.getSelectionModel();
        lsmServicios.addListSelectionListener(new ListSelectionListener(){
            public void valueChanged(ListSelectionEvent e){
                if(! e.getValueIsAdjusting()){
                    tablaLineaSeleccionadaServicio(tableServicio);
                }
            }

        });
        jScrollPane4.setViewportView(tableServicio);

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(txtBuscarServicio, javax.swing.GroupLayout.PREFERRED_SIZE, 435, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(29, 29, 29)
                        .addComponent(btnBuscarServicio, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(jPanelDatosServicio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jPanelBotonesServicio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jScrollPane4))
                .addContainerGap(133, Short.MAX_VALUE))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGap(22, 22, 22)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtBuscarServicio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnBuscarServicio))
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addGap(18, 18, 18)
                        .addComponent(jPanelDatosServicio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addGap(27, 27, 27)
                        .addComponent(jPanelBotonesServicio, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addGap(18, 18, 18)
                .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 148, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(147, 147, 147))
        );

        PanelPrincipal.addTab("Servicios", jPanel4);

        btnBuscarReserva.setFont(new java.awt.Font("Trebuchet MS", 1, 14));
        btnBuscarReserva.setText("Buscar");
        btnBuscarReserva.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnBuscarReservaActionPerformed(evt);
            }
        });

        txtBuscarReserva.setFont(new java.awt.Font("Trebuchet MS", 0, 14));

        jPanelDatosReserva.setBorder(javax.swing.BorderFactory.createTitledBorder("Datos de Contacto"));
        jPanelDatosReserva.setFont(new java.awt.Font("Trebuchet MS", 0, 14));

        lblidReserva.setFont(new java.awt.Font("Trebuchet MS", 0, 14));
        lblidReserva.setText("Id");

        lblFechaInicio.setFont(new java.awt.Font("Trebuchet MS", 0, 14));
        lblFechaInicio.setText("Fecha Inicio");

        lblFechaFin.setFont(new java.awt.Font("Trebuchet MS", 0, 14));
        lblFechaFin.setText("Fecha Fin");

        lblFecha.setFont(new java.awt.Font("Trebuchet MS", 0, 14));
        lblFecha.setText("Fecha");

        lblHabitacionesDisponibles.setFont(new java.awt.Font("Trebuchet MS", 0, 14));
        lblHabitacionesDisponibles.setText("Habitaciones Disponibles :");

        txtidReserva.setFont(new java.awt.Font("Trebuchet MS", 0, 14));

        txtFechaInicio.setFont(new java.awt.Font("Trebuchet MS", 0, 14));

        txtFechaFin.setFont(new java.awt.Font("Trebuchet MS", 0, 14));

        txtFecha.setFont(new java.awt.Font("Trebuchet MS", 0, 14));
        txtFecha.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtFechaActionPerformed(evt);
            }
        });

        tableHabitacionesDisponibles.setFont(new java.awt.Font("Calibri", 0, 14));
        tableHabitacionesDisponibles.setModel(tablaHabitaciones);
        tableUsuario.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        lsmHabitacionesDisponibles = tableHabitacionesDisponibles.getSelectionModel();
        lsmHabitacionesDisponibles.addListSelectionListener(new ListSelectionListener(){
            public void valueChanged(ListSelectionEvent e){
                if(! e.getValueIsAdjusting()){
                    jTTtablaLineaSeleccionada(tableHabitacionesDisponibles);
                }
            }

        });
        jScrollPane6.setViewportView(tableHabitacionesDisponibles);

        tableHabitacionesReservadas.setFont(new java.awt.Font("Calibri", 0, 14));
        tableHabitacionesReservadas.setModel(tablaHabitaciones);
        tableUsuario.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        lsmHabitacionesReservadas = tableHabitacionesReservadas.getSelectionModel();
        lsmHabitacionesReservadas.addListSelectionListener(new ListSelectionListener(){
            public void valueChanged(ListSelectionEvent e){
                if(! e.getValueIsAdjusting()){
                    jTTtablaLineaSeleccionada(tableHabitacionesReservadas);
                }
            }

        });
        jScrollPane7.setViewportView(tableHabitacionesReservadas);

        btnAgregarHabitacion.setFont(new java.awt.Font("Trebuchet MS", 1, 14));
        btnAgregarHabitacion.setText("Agregar");

        lblCliente.setFont(new java.awt.Font("Trebuchet MS", 0, 14));
        lblCliente.setText("Cliente :");

        tableClientesRegistrados.setFont(new java.awt.Font("Calibri", 0, 14));
        tableClientesRegistrados.setModel(tablaClientes2);
        tableUsuario.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        lsmClientes = tableClientesRegistrados.getSelectionModel();
        lsmClientes.addListSelectionListener(new ListSelectionListener(){
            public void valueChanged(ListSelectionEvent e){
                if(! e.getValueIsAdjusting()){
                    jTTtablaLineaSeleccionada(tableClientesRegistrados);
                }
            }

        });
        jScrollPane8.setViewportView(tableClientesRegistrados);

        javax.swing.GroupLayout jPanelDatosReservaLayout = new javax.swing.GroupLayout(jPanelDatosReserva);
        jPanelDatosReserva.setLayout(jPanelDatosReservaLayout);
        jPanelDatosReservaLayout.setHorizontalGroup(
            jPanelDatosReservaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelDatosReservaLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelDatosReservaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblFechaFin)
                    .addComponent(lblidReserva)
                    .addComponent(lblCliente)
                    .addComponent(lblFechaInicio)
                    .addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, 146, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelDatosReservaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelDatosReservaLayout.createSequentialGroup()
                        .addGroup(jPanelDatosReservaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(txtFechaFin, javax.swing.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE)
                            .addComponent(txtFechaInicio, javax.swing.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE))
                        .addGap(18, 18, 18)
                        .addGroup(jPanelDatosReservaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanelDatosReservaLayout.createSequentialGroup()
                                .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 137, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(btnAgregarHabitacion)
                                .addGap(8, 8, 8)
                                .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 137, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(lblHabitacionesDisponibles))
                        .addGap(4, 4, 4))
                    .addGroup(jPanelDatosReservaLayout.createSequentialGroup()
                        .addComponent(txtidReserva, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(111, 111, 111)
                        .addComponent(lblFecha)
                        .addGap(28, 28, 28)
                        .addComponent(txtFecha, javax.swing.GroupLayout.PREFERRED_SIZE, 108, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        jPanelDatosReservaLayout.setVerticalGroup(
            jPanelDatosReservaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelDatosReservaLayout.createSequentialGroup()
                .addGroup(jPanelDatosReservaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblidReserva)
                    .addComponent(txtidReserva, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lblFecha)
                    .addComponent(txtFecha, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelDatosReservaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelDatosReservaLayout.createSequentialGroup()
                        .addGroup(jPanelDatosReservaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(txtFechaInicio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblFechaInicio))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanelDatosReservaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lblFechaFin)
                            .addComponent(txtFechaFin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(lblCliente)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jScrollPane8, javax.swing.GroupLayout.DEFAULT_SIZE, 84, Short.MAX_VALUE))
                    .addGroup(jPanelDatosReservaLayout.createSequentialGroup()
                        .addGap(12, 12, 12)
                        .addComponent(lblHabitacionesDisponibles)
                        .addGroup(jPanelDatosReservaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanelDatosReservaLayout.createSequentialGroup()
                                .addGap(18, 18, 18)
                                .addGroup(jPanelDatosReservaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGroup(jPanelDatosReservaLayout.createSequentialGroup()
                                .addGap(57, 57, 57)
                                .addComponent(btnAgregarHabitacion)))))
                .addContainerGap())
        );

        btnNuevoReserva.setFont(new java.awt.Font("Trebuchet MS", 1, 14));
        btnNuevoReserva.setText("Nuevo");
        btnNuevoReserva.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnNuevoReservaActionPerformed(evt);
            }
        });

        btnEliminarReserva.setFont(new java.awt.Font("Trebuchet MS", 1, 14));
        btnEliminarReserva.setText("Eliminar");
        btnEliminarReserva.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnEliminarReservaActionPerformed(evt);
            }
        });

        btnGuardarReserva.setFont(new java.awt.Font("Trebuchet MS", 1, 14));
        btnGuardarReserva.setText("Guardar");
        btnGuardarReserva.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnGuardarReservaActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanelBotonesReservaLayout = new javax.swing.GroupLayout(jPanelBotonesReserva);
        jPanelBotonesReserva.setLayout(jPanelBotonesReservaLayout);
        jPanelBotonesReservaLayout.setHorizontalGroup(
            jPanelBotonesReservaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelBotonesReservaLayout.createSequentialGroup()
                .addGap(181, 181, 181)
                .addComponent(btnNuevoReserva)
                .addGap(52, 52, 52)
                .addComponent(btnGuardarReserva)
                .addGap(50, 50, 50)
                .addComponent(btnEliminarReserva)
                .addContainerGap(193, Short.MAX_VALUE))
        );
        jPanelBotonesReservaLayout.setVerticalGroup(
            jPanelBotonesReservaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelBotonesReservaLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanelBotonesReservaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnNuevoReserva)
                    .addComponent(btnEliminarReserva)
                    .addComponent(btnGuardarReserva)))
        );

        tableReserva.setFont(new java.awt.Font("Calibri", 0, 14));
        tableReserva.setModel(tablaReservas);
        tableUsuario.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        lsmReservas = tableReserva.getSelectionModel();
        lsmReservas.addListSelectionListener(new ListSelectionListener(){
            public void valueChanged(ListSelectionEvent e){
                if(! e.getValueIsAdjusting()){
                    jTTtablaLineaSeleccionada(tableReserva);
                }
            }

        });
        jScrollPane5.setViewportView(tableReserva);

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addComponent(txtBuscarReserva, javax.swing.GroupLayout.PREFERRED_SIZE, 435, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(29, 29, 29)
                        .addComponent(btnBuscarReserva, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jPanelDatosReserva, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addComponent(jPanelBotonesReserva, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jScrollPane5, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 717, Short.MAX_VALUE)))
                .addContainerGap(87, Short.MAX_VALUE))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addGap(22, 22, 22)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtBuscarReserva, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnBuscarReserva))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanelDatosReserva, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanelBotonesReserva, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(100, Short.MAX_VALUE))
        );

        PanelPrincipal.addTab("Reservas", jPanel5);

        jPanelDatosCuenta.setBorder(javax.swing.BorderFactory.createTitledBorder("Datos de Contacto"));
        jPanelDatosCuenta.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        jPanelDatosCuenta.setFont(new java.awt.Font("Trebuchet MS", 0, 14));

        tableCuenta.setFont(new java.awt.Font("Calibri", 0, 14));
        tableCuenta.setModel(tablaCuenta);
        tableUsuario.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        lsmCuenta = tableCuenta.getSelectionModel();
        lsmCuenta.addListSelectionListener(new ListSelectionListener(){
            public void valueChanged(ListSelectionEvent e){
                if(! e.getValueIsAdjusting()){
                    jTTtablaLineaSeleccionada(tableCuenta);
                }
            }

        });
        jScrollPane11.setViewportView(tableCuenta);

        btnMostrar.setFont(new java.awt.Font("Trebuchet MS", 1, 14));
        btnMostrar.setText("Mostrar");

        btnPagar.setFont(new java.awt.Font("Trebuchet MS", 1, 14));
        btnPagar.setText("Pagar");

        javax.swing.GroupLayout jPanelDatosCuentaLayout = new javax.swing.GroupLayout(jPanelDatosCuenta);
        jPanelDatosCuenta.setLayout(jPanelDatosCuentaLayout);
        jPanelDatosCuentaLayout.setHorizontalGroup(
            jPanelDatosCuentaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelDatosCuentaLayout.createSequentialGroup()
                .addContainerGap(325, Short.MAX_VALUE)
                .addComponent(btnMostrar, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(38, 38, 38)
                .addComponent(jScrollPane11, javax.swing.GroupLayout.PREFERRED_SIZE, 199, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(btnPagar)
                .addGap(14, 14, 14))
        );
        jPanelDatosCuentaLayout.setVerticalGroup(
            jPanelDatosCuentaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelDatosCuentaLayout.createSequentialGroup()
                .addGroup(jPanelDatosCuentaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane11, javax.swing.GroupLayout.PREFERRED_SIZE, 152, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanelDatosCuentaLayout.createSequentialGroup()
                        .addGap(50, 50, 50)
                        .addComponent(btnMostrar))
                    .addGroup(jPanelDatosCuentaLayout.createSequentialGroup()
                        .addGap(56, 56, 56)
                        .addComponent(btnPagar)))
                .addContainerGap(40, Short.MAX_VALUE))
        );

        jPanelDatosIngresos.setBorder(javax.swing.BorderFactory.createTitledBorder("Datos de Contacto"));
        jPanelDatosIngresos.setFont(new java.awt.Font("Trebuchet MS", 0, 14));

        lblFechaInicioIngresos.setFont(new java.awt.Font("Trebuchet MS", 0, 14));
        lblFechaInicioIngresos.setText("Fecha Inicio");

        txtFechaInicioIngresos.setFont(new java.awt.Font("Trebuchet MS", 0, 14));

        lblFechaFinIngresos.setFont(new java.awt.Font("Trebuchet MS", 0, 14));
        lblFechaFinIngresos.setText("Fecha Fin");

        txtFechaFinIngresos.setFont(new java.awt.Font("Trebuchet MS", 0, 14));

        btnVerIngresos.setFont(new java.awt.Font("Trebuchet MS", 1, 14));
        btnVerIngresos.setText("Ver Ingresos");

        tableIngresos.setFont(new java.awt.Font("Calibri", 0, 14));
        tableIngresos.setModel(tablaIngresos);
        tableUsuario.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        lsmIngresos = tableIngresos.getSelectionModel();
        lsmIngresos.addListSelectionListener(new ListSelectionListener(){
            public void valueChanged(ListSelectionEvent e){
                if(! e.getValueIsAdjusting()){
                    jTTtablaLineaSeleccionada(tableIngresos);
                }
            }

        });
        jScrollPane9.setViewportView(tableIngresos);

        lblTotal.setFont(new java.awt.Font("Trebuchet MS", 0, 14));
        lblTotal.setText("Total : $");

        txtTotal.setFont(new java.awt.Font("Trebuchet MS", 1, 14));

        javax.swing.GroupLayout jPanelDatosIngresosLayout = new javax.swing.GroupLayout(jPanelDatosIngresos);
        jPanelDatosIngresos.setLayout(jPanelDatosIngresosLayout);
        jPanelDatosIngresosLayout.setHorizontalGroup(
            jPanelDatosIngresosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelDatosIngresosLayout.createSequentialGroup()
                .addGroup(jPanelDatosIngresosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelDatosIngresosLayout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanelDatosIngresosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(lblFechaFinIngresos)
                            .addComponent(lblFechaInicioIngresos))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanelDatosIngresosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(txtFechaFinIngresos, javax.swing.GroupLayout.DEFAULT_SIZE, 170, Short.MAX_VALUE)
                            .addComponent(txtFechaInicioIngresos, javax.swing.GroupLayout.DEFAULT_SIZE, 170, Short.MAX_VALUE)))
                    .addGroup(jPanelDatosIngresosLayout.createSequentialGroup()
                        .addGap(106, 106, 106)
                        .addComponent(btnVerIngresos)
                        .addGap(41, 41, 41)))
                .addGap(18, 18, 18)
                .addGroup(jPanelDatosIngresosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelDatosIngresosLayout.createSequentialGroup()
                        .addComponent(lblTotal)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(txtTotal, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jScrollPane9, javax.swing.GroupLayout.PREFERRED_SIZE, 332, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(135, 135, 135))
        );
        jPanelDatosIngresosLayout.setVerticalGroup(
            jPanelDatosIngresosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelDatosIngresosLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelDatosIngresosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane9, javax.swing.GroupLayout.PREFERRED_SIZE, 112, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanelDatosIngresosLayout.createSequentialGroup()
                        .addGroup(jPanelDatosIngresosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(txtFechaInicioIngresos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblFechaInicioIngresos))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanelDatosIngresosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lblFechaFinIngresos)
                            .addComponent(txtFechaFinIngresos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addComponent(btnVerIngresos)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanelDatosIngresosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblTotal, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(txtTotal, javax.swing.GroupLayout.DEFAULT_SIZE, 25, Short.MAX_VALUE))
                .addContainerGap())
        );

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanelDatosCuenta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(46, Short.MAX_VALUE))
            .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel6Layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(jPanelDatosIngresos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(51, Short.MAX_VALUE)))
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup()
                .addContainerGap(313, Short.MAX_VALUE)
                .addComponent(jPanelDatosCuenta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
            .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel6Layout.createSequentialGroup()
                    .addGap(21, 21, 21)
                    .addComponent(jPanelDatosIngresos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(325, Short.MAX_VALUE)))
        );

        jPanelDatosCuenta.getAccessibleContext().setAccessibleName("Cuenta");
        jPanelDatosIngresos.getAccessibleContext().setAccessibleName("Ingresos");

        PanelPrincipal.addTab("Cobranza", jPanel6);

        txtBuscarRenta.setFont(new java.awt.Font("Trebuchet MS", 0, 14));

        btnBuscarRenta.setFont(new java.awt.Font("Trebuchet MS", 1, 14));
        btnBuscarRenta.setText("Buscar");
        btnBuscarRenta.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnBuscarRentaActionPerformed(evt);
            }
        });

        jPanelDatosReserva1.setBorder(javax.swing.BorderFactory.createTitledBorder("Datos de Contacto"));
        jPanelDatosReserva1.setFont(new java.awt.Font("Trebuchet MS", 0, 14));

        lblidReserva1.setFont(new java.awt.Font("Trebuchet MS", 0, 14));
        lblidReserva1.setText("Id");

        lblFechaInicio1.setFont(new java.awt.Font("Trebuchet MS", 0, 14));
        lblFechaInicio1.setText("Fecha Inicio");

        lblFechaFin1.setFont(new java.awt.Font("Trebuchet MS", 0, 14));
        lblFechaFin1.setText("Fecha Fin");

        lblHabitacionesDisponibles1.setFont(new java.awt.Font("Trebuchet MS", 0, 14));
        lblHabitacionesDisponibles1.setText("Habitaciones Disponibles :");

        txtidReserva1.setFont(new java.awt.Font("Trebuchet MS", 0, 14));

        txtFechaInicio1.setFont(new java.awt.Font("Trebuchet MS", 0, 14));

        txtFechaFin1.setFont(new java.awt.Font("Trebuchet MS", 0, 14));

        tableHabitacionesDisponibles1.setFont(new java.awt.Font("Calibri", 0, 14));
        tableHabitacionesDisponibles1.setModel(tablaHabitaciones);
        tableUsuario.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        lsmHabitacionesDisponibles = tableHabitacionesDisponibles.getSelectionModel();
        lsmHabitacionesDisponibles.addListSelectionListener(new ListSelectionListener(){
            public void valueChanged(ListSelectionEvent e){
                if(! e.getValueIsAdjusting()){
                    jTTtablaLineaSeleccionada(tableHabitacionesDisponibles);
                }
            }

        });
        jScrollPane10.setViewportView(tableHabitacionesDisponibles1);

        tableHabitacionesReservadas1.setFont(new java.awt.Font("Calibri", 0, 14));
        tableHabitacionesReservadas1.setModel(tablaHabitaciones);
        tableUsuario.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        lsmHabitacionesReservadas = tableHabitacionesReservadas.getSelectionModel();
        lsmHabitacionesReservadas.addListSelectionListener(new ListSelectionListener(){
            public void valueChanged(ListSelectionEvent e){
                if(! e.getValueIsAdjusting()){
                    jTTtablaLineaSeleccionada(tableHabitacionesReservadas);
                }
            }

        });
        jScrollPane16.setViewportView(tableHabitacionesReservadas1);

        btnAgregarHabitacion2.setFont(new java.awt.Font("Trebuchet MS", 1, 14));
        btnAgregarHabitacion2.setText("Agregar");

        lblCliente1.setFont(new java.awt.Font("Trebuchet MS", 0, 14));
        lblCliente1.setText("Cliente :");

        tableClientesRegistrados1.setFont(new java.awt.Font("Calibri", 0, 14));
        tableClientesRegistrados1.setModel(tablaClientes2);
        tableUsuario.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        lsmClientes = tableClientesRegistrados.getSelectionModel();
        lsmClientes.addListSelectionListener(new ListSelectionListener(){
            public void valueChanged(ListSelectionEvent e){
                if(! e.getValueIsAdjusting()){
                    jTTtablaLineaSeleccionada(tableClientesRegistrados);
                }
            }

        });
        jScrollPane17.setViewportView(tableClientesRegistrados1);

        javax.swing.GroupLayout jPanelDatosReserva1Layout = new javax.swing.GroupLayout(jPanelDatosReserva1);
        jPanelDatosReserva1.setLayout(jPanelDatosReserva1Layout);
        jPanelDatosReserva1Layout.setHorizontalGroup(
            jPanelDatosReserva1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelDatosReserva1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelDatosReserva1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblFechaFin1)
                    .addComponent(lblidReserva1)
                    .addComponent(lblCliente1)
                    .addComponent(lblFechaInicio1)
                    .addComponent(jScrollPane17, javax.swing.GroupLayout.PREFERRED_SIZE, 146, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelDatosReserva1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelDatosReserva1Layout.createSequentialGroup()
                        .addGroup(jPanelDatosReserva1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(txtFechaFin1, javax.swing.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE)
                            .addComponent(txtFechaInicio1, javax.swing.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE))
                        .addGap(18, 18, 18))
                    .addGroup(jPanelDatosReserva1Layout.createSequentialGroup()
                        .addComponent(txtidReserva1, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(110, 110, 110)))
                .addGroup(jPanelDatosReserva1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelDatosReserva1Layout.createSequentialGroup()
                        .addComponent(jScrollPane10, javax.swing.GroupLayout.PREFERRED_SIZE, 137, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(10, 10, 10)
                        .addComponent(btnAgregarHabitacion2)
                        .addGap(6, 6, 6)
                        .addComponent(jScrollPane16, javax.swing.GroupLayout.PREFERRED_SIZE, 137, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(lblHabitacionesDisponibles1))
                .addGap(12, 12, 12))
        );
        jPanelDatosReserva1Layout.setVerticalGroup(
            jPanelDatosReserva1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelDatosReserva1Layout.createSequentialGroup()
                .addGroup(jPanelDatosReserva1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelDatosReserva1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(lblidReserva1)
                        .addComponent(txtidReserva1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanelDatosReserva1Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(lblHabitacionesDisponibles1)))
                .addGap(18, 18, 18)
                .addGroup(jPanelDatosReserva1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelDatosReserva1Layout.createSequentialGroup()
                        .addGroup(jPanelDatosReserva1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(txtFechaInicio1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblFechaInicio1))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanelDatosReserva1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lblFechaFin1)
                            .addComponent(txtFechaFin1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(lblCliente1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jScrollPane17, javax.swing.GroupLayout.DEFAULT_SIZE, 84, Short.MAX_VALUE))
                    .addComponent(jScrollPane10, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanelDatosReserva1Layout.createSequentialGroup()
                        .addGap(5, 5, 5)
                        .addGroup(jPanelDatosReserva1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jScrollPane16, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(btnAgregarHabitacion2))))
                .addContainerGap())
        );

        btnNuevoReserva1.setFont(new java.awt.Font("Trebuchet MS", 1, 14));
        btnNuevoReserva1.setText("Nuevo");
        btnNuevoReserva1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnNuevoReserva1ActionPerformed(evt);
            }
        });

        btnEliminarReserva1.setFont(new java.awt.Font("Trebuchet MS", 1, 14));
        btnEliminarReserva1.setText("Eliminar");
        btnEliminarReserva1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnEliminarReserva1ActionPerformed(evt);
            }
        });

        btnGuardarReserva1.setFont(new java.awt.Font("Trebuchet MS", 1, 14));
        btnGuardarReserva1.setText("Guardar");
        btnGuardarReserva1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnGuardarReserva1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanelBotonesReserva1Layout = new javax.swing.GroupLayout(jPanelBotonesReserva1);
        jPanelBotonesReserva1.setLayout(jPanelBotonesReserva1Layout);
        jPanelBotonesReserva1Layout.setHorizontalGroup(
            jPanelBotonesReserva1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelBotonesReserva1Layout.createSequentialGroup()
                .addGap(181, 181, 181)
                .addComponent(btnNuevoReserva1)
                .addGap(52, 52, 52)
                .addComponent(btnGuardarReserva1)
                .addGap(50, 50, 50)
                .addComponent(btnEliminarReserva1)
                .addContainerGap(193, Short.MAX_VALUE))
        );
        jPanelBotonesReserva1Layout.setVerticalGroup(
            jPanelBotonesReserva1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelBotonesReserva1Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanelBotonesReserva1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnNuevoReserva1)
                    .addComponent(btnEliminarReserva1)
                    .addComponent(btnGuardarReserva1)))
        );

        tableReserva1.setFont(new java.awt.Font("Calibri", 0, 14));
        tableReserva1.setModel(tablaReservas);
        tableUsuario.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        lsmReservas = tableReserva.getSelectionModel();
        lsmReservas.addListSelectionListener(new ListSelectionListener(){
            public void valueChanged(ListSelectionEvent e){
                if(! e.getValueIsAdjusting()){
                    jTTtablaLineaSeleccionada(tableReserva);
                }
            }

        });
        jScrollPane18.setViewportView(tableReserva1);

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addComponent(txtBuscarRenta, javax.swing.GroupLayout.PREFERRED_SIZE, 435, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(29, 29, 29)
                        .addComponent(btnBuscarRenta, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jPanelDatosReserva1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addComponent(jPanelBotonesReserva1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jScrollPane18, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 717, Short.MAX_VALUE)))
                .addContainerGap(81, Short.MAX_VALUE))
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addGap(22, 22, 22)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtBuscarRenta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnBuscarRenta))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanelDatosReserva1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanelBotonesReserva1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jScrollPane18, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(83, Short.MAX_VALUE))
        );

        PanelPrincipal.addTab("Renta", jPanel7);

        btnSalir.setFont(new java.awt.Font("Trebuchet MS", 1, 18));
        btnSalir.setText("Salir");
        btnSalir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSalirActionPerformed(evt);
            }
        });

        lblUsuario.setFont(new java.awt.Font("Trebuchet MS", 0, 14));
        lblUsuario.setText("Usuario");

        lblContrasena.setFont(new java.awt.Font("Trebuchet MS", 0, 14));
        lblContrasena.setText("Contraseña");

        txtUsuario.setFont(new java.awt.Font("Trebuchet MS", 0, 14));

        txtContrasena.setFont(new java.awt.Font("Trebuchet MS", 1, 14));

        btnEntrar.setFont(new java.awt.Font("Trebuchet MS", 1, 18));
        btnEntrar.setText("Entrar");
        btnEntrar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnEntrarActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(PanelPrincipal, javax.swing.GroupLayout.DEFAULT_SIZE, 823, Short.MAX_VALUE))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(22, 22, 22)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(lblUsuario)
                            .addComponent(lblContrasena))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(txtContrasena)
                            .addComponent(txtUsuario, javax.swing.GroupLayout.DEFAULT_SIZE, 168, Short.MAX_VALUE))
                        .addGap(28, 28, 28)
                        .addComponent(btnEntrar)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 139, Short.MAX_VALUE)
                        .addComponent(txtInfoTrabajador, javax.swing.GroupLayout.PREFERRED_SIZE, 221, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(btnSalir)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lblUsuario)
                            .addComponent(txtUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(12, 12, 12)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lblContrasena)
                            .addComponent(txtContrasena, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(26, 26, 26)
                        .addComponent(btnEntrar, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(btnSalir, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtInfoTrabajador, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addGap(24, 24, 24)
                .addComponent(PanelPrincipal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btnGuardarUsuarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnGuardarUsuarioActionPerformed
        if(verificarDatosUsuario()){
            guardarUsuarios();
            deshabilitaDatos();
            try {
                listarUsuarios();
            } catch (SQLException ex) {
                Logger.getLogger(SAR.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
}//GEN-LAST:event_btnGuardarUsuarioActionPerformed

    private void btnEliminarUsuarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEliminarUsuarioActionPerformed
        try {
            eliminarUsuario();
            listarUsuarios();
        } catch (SQLException ex) {
            JOptionPane.showMessageDialog(null, "Error al eliminar" + ex);
        }
}//GEN-LAST:event_btnEliminarUsuarioActionPerformed

    private void btnNuevoUsuarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNuevoUsuarioActionPerformed
        habilitaDatosUsuario();
        txtNombreUsuario.setText("");
        txtApellidosUsuario.setText("");
        txtDireccionUsuario.setText("");
        txtContrasenaUsuario.setText("");
}//GEN-LAST:event_btnNuevoUsuarioActionPerformed

    private void txtContrasenaUsuarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtContrasenaUsuarioActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_txtContrasenaUsuarioActionPerformed

    private void btnBuscarUsuarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBuscarUsuarioActionPerformed
        try {
            listarUsuariosBusqueda();
        } catch (SQLException ex) {
            JOptionPane.showMessageDialog(null, "Error al buscar" + ex);
        }
}//GEN-LAST:event_btnBuscarUsuarioActionPerformed

    private void btnBuscarClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBuscarClienteActionPerformed
        // TODO add your handling code here:
        try {
            listarClientesBusqueda();
        } catch (SQLException ex) {
            JOptionPane.showMessageDialog(null, "Error al buscar" + ex);
        }
    }//GEN-LAST:event_btnBuscarClienteActionPerformed

    private void btnNuevoClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNuevoClienteActionPerformed
        habilitaDatosCliente();
        txtNombreCliente.setText("");
        txtApellidosCliente.setText("");
        txtDireccionCliente.setText("");
        txtTelefonoCliente.setText("");   // TODO add your handling code here:
        checkCliente.setSelected(false);
    }//GEN-LAST:event_btnNuevoClienteActionPerformed

    private void btnEliminarClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEliminarClienteActionPerformed
        try {
            eliminarCliente();
            listarClientes();
        } catch (SQLException ex) {
            JOptionPane.showMessageDialog(null, "Error al eliminar" + ex);
        }        // TODO add your handling code here:
    }//GEN-LAST:event_btnEliminarClienteActionPerformed

    private void btnGuardarClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnGuardarClienteActionPerformed
        if(verificarDatosCliente()){
            guardarClientes();
            deshabilitaDatos();
            try {
                listarClientes();
            } catch (SQLException ex) {
                Logger.getLogger(SAR.class.getName()).log(Level.SEVERE, null, ex);
            }
        }         // TODO add your handling code here:
    }//GEN-LAST:event_btnGuardarClienteActionPerformed

    private void btnBuscarPaqueteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBuscarPaqueteActionPerformed
        // TODO add your handling code here:
        try {
            listarPaquetes();
        } catch (SQLException ex) {
            JOptionPane.showMessageDialog(null, "Error al buscar" + ex);
        }
    }//GEN-LAST:event_btnBuscarPaqueteActionPerformed

    private void btnNuevoPaqueteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNuevoPaqueteActionPerformed
        habilitaDatosPaquete();
        txtidPaquete.setText("");
        txtNombrePaquete.setText("");
        txtDescripcionPaquete.setText("");
        txtPrecioPaquete.setText("");
    }//GEN-LAST:event_btnNuevoPaqueteActionPerformed

    private void btnModificarPaqueteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnModificarPaqueteActionPerformed
        // TODO add your handling code here:
        try {
            modificarPaquete();
            listarPaquetes();
        } catch (SQLException ex) {
            JOptionPane.showMessageDialog(null, "Error al modificar" + ex);
        }
    }//GEN-LAST:event_btnModificarPaqueteActionPerformed

    private void btnEliminarPaqueteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEliminarPaqueteActionPerformed
        // TODO add your handling code here:
        try {
            eliminarPaquete();
            listarPaquetes();
        } catch (SQLException ex) {
            JOptionPane.showMessageDialog(null, "Error al eliminar" + ex);
        }
    }//GEN-LAST:event_btnEliminarPaqueteActionPerformed

    private void btnGuardarPaqueteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnGuardarPaqueteActionPerformed
        // TODO add your handling code here:
        if(verificarDatosPaquete()){
            guardarPaquete();
            deshabilitaDatos();
            try {
                listarPaquetes();
            } catch (SQLException ex) {
                Logger.getLogger(SAR.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    }//GEN-LAST:event_btnGuardarPaqueteActionPerformed

    private void txtPrecioPaqueteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtPrecioPaqueteActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtPrecioPaqueteActionPerformed

    private void btnBuscarServicioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBuscarServicioActionPerformed
        // TODO add your handling code here:
        try {
            listarServiciosBusqueda();
        } catch (SQLException ex) {
            JOptionPane.showMessageDialog(null, "Error al buscar" + ex);
        }
    }//GEN-LAST:event_btnBuscarServicioActionPerformed

    private void btnNuevoServicioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNuevoServicioActionPerformed
        habilitaDatosServicio();        // TODO add your handling code here:
        txtNombreServicio.setVisible(true);
        txtPrecioServicio.setVisible(true);
    }//GEN-LAST:event_btnNuevoServicioActionPerformed

    private void btnModificarServicioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnModificarServicioActionPerformed
        // TODO add your handling code here:
        try {
            modificarServicio();
            listarServicios();
        } catch (SQLException ex) {
            JOptionPane.showMessageDialog(null, "Error al modificar" + ex);
        }
    }//GEN-LAST:event_btnModificarServicioActionPerformed

    private void btnEliminarServicioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEliminarServicioActionPerformed
        // TODO add your handling code here:
        try {
            eliminarServicio();
            listarServicios();
        } catch (SQLException ex) {
            JOptionPane.showMessageDialog(null, "Error al eliminar" + ex);
        }
    }//GEN-LAST:event_btnEliminarServicioActionPerformed

    private void btnGuardarServicioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnGuardarServicioActionPerformed
        if(verificarDatosServicio()){
            guardarServicios();
            deshabilitaDatos();
            try {
                listarServicios();
            } catch (SQLException ex) {
                Logger.getLogger(SAR.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    }//GEN-LAST:event_btnGuardarServicioActionPerformed

    private void btnBuscarReservaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBuscarReservaActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_btnBuscarReservaActionPerformed

    private void btnNuevoReservaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNuevoReservaActionPerformed
        habilitaDatosReserva();        // TODO add your handling code here:
    }//GEN-LAST:event_btnNuevoReservaActionPerformed

    private void btnEliminarReservaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEliminarReservaActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_btnEliminarReservaActionPerformed

    private void btnGuardarReservaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnGuardarReservaActionPerformed
        deshabilitaDatos();        // TODO add your handling code here:
    }//GEN-LAST:event_btnGuardarReservaActionPerformed

    private void txtFechaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtFechaActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtFechaActionPerformed

    private void btnEntrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEntrarActionPerformed
        try {
            if (verificarDatosEntrar() && logIn()) {
                lblUsuario.setVisible(false);
                lblContrasena.setVisible(false);
                txtUsuario.setVisible(false);
                txtContrasena.setVisible(false);
                btnEntrar.setVisible(false);
                PanelPrincipal.setVisible(true);
                txtInfoTrabajador.setVisible(true);
                btnSalir.setVisible(true);
                txtUsuario.setText("");
                txtContrasena.setText("");
            }
            else
            {   JOptionPane.showMessageDialog(rootPane, "¡Error! Verifique su Usuario y Contraseña");
                txtUsuario.setText("");
                txtContrasena.setText("");}
        } catch (SQLException ex) {
            Logger.getLogger(SAR.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_btnEntrarActionPerformed

    private void btnSalirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSalirActionPerformed
        int resp = JOptionPane.showConfirmDialog(this, "¿Desea salir?",
                "Confirmación", JOptionPane.YES_NO_OPTION);
            if (resp == JOptionPane.YES_NO_OPTION) {
                PanelPrincipal.setVisible(false);
                txtInfoTrabajador.setVisible(false);
                btnSalir.setVisible(false);
                lblUsuario.setVisible(true);
                lblContrasena.setVisible(true);
                txtUsuario.setVisible(true);
                txtContrasena.setVisible(true);
                btnEntrar.setVisible(true);
        }
    }//GEN-LAST:event_btnSalirActionPerformed

    private void checkAdministradorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkAdministradorActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_checkAdministradorActionPerformed

    private void checkClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkClienteActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_checkClienteActionPerformed

    private void btnBuscarRentaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBuscarRentaActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_btnBuscarRentaActionPerformed

    private void btnGuardarReserva1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnGuardarReserva1ActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_btnGuardarReserva1ActionPerformed

    private void btnEliminarReserva1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEliminarReserva1ActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_btnEliminarReserva1ActionPerformed

    private void btnNuevoReserva1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNuevoReserva1ActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_btnNuevoReserva1ActionPerformed

    private void deshabilitaDatos(){
        txtInfoTrabajador.setEditable(false);
        //Datos de los Usuarios
        txtidUsuario.setEditable(false);
        txtNombreUsuario.setEditable(false);
        txtApellidosUsuario.setEditable(false);
        txtDireccionUsuario.setEditable(false);
        txtContrasenaUsuario.setEditable(false);
        //Datos de los Clientes
        txtidCliente.setEditable(false);
        txtNombreCliente.setEditable(false);
        txtApellidosCliente.setEditable(false);
        txtDireccionCliente.setEditable(false);
        txtTelefonoCliente.setEditable(false);
        checkCliente.enable(false);
        //Datos de los Paquetes
        txtidPaquete.setEditable(false);
        txtNombrePaquete.setEditable(false);
        txtDescripcionPaquete.setEditable(false);
        txtPrecioPaquete.setEditable(false);
        //Datos de los Servicios
        txtidServicio.setEditable(false);
        txtNombreServicio.setEditable(false);
        txtPrecioServicio.setEditable(false);
        //Datos de las Reservas
        txtidReserva.setEditable(false);
        txtFechaInicio.setEditable(false);
        txtFechaFin.setEditable(false);
        txtFecha.setEditable(false);
        //Datos de la Cobranza
        txtTotal.setEditable(false);
    }

    private void habilitaDatosUsuario(){
        txtNombreUsuario.setEditable(true);
        txtApellidosUsuario.setEditable(true);
        txtDireccionUsuario.setEditable(true);
        txtContrasenaUsuario.setEditable(true);
    }

    private void habilitaDatosCliente(){
        txtNombreCliente.setEditable(true);
        txtApellidosCliente.setEditable(true);
        txtDireccionCliente.setEditable(true);
        txtTelefonoCliente.setEditable(true);
        checkCliente.enable(true);
    }

    private void habilitaDatosPaquete(){
        txtNombrePaquete.setEditable(true);
        txtDescripcionPaquete.setEditable(true);
        txtPrecioPaquete.setEditable(true);
    }

    private void habilitaDatosServicio(){
        txtNombreServicio.setEditable(true);
        txtPrecioServicio.setEditable(true);
    }

    private void habilitaDatosReserva(){
        txtFechaInicio.setEditable(true);
        txtFechaFin.setEditable(true);
        txtFecha.setEditable(true);
    }

    /************************************************************************/
    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
    
    java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new SAR().setVisible(true);
            }
        });
    }

    /*****************************DATOS ENTRAR******************************/

    public boolean verificarDatosEntrar(){
        if (!txtUsuario.getText().equals("") && !txtContrasena.getText().equals("")){
            return true;
        }
        else{
            return false;
        }
    }

    public boolean logIn() throws SQLException{
        
            UsuarioDao u1Dao = new UsuarioDao();
            int result = u1Dao.entrar(txtUsuario.getText(),txtContrasena.getText());
            if(result == 0)
            {
                return false;
            }
            else
                return true;
    }

    /****************************USUARIO************************************/
    public boolean verificarDatosUsuario(){
        if (!txtNombreUsuario.getText().equals("") && !txtApellidosUsuario.getText().equals("") &&
            !txtDireccionUsuario.getText().equals("")){
            return true;
        }
        else{
            JOptionPane.showMessageDialog(null, "¡Error! Complete todos los formularios");
            return false;
        }
    }

    private void tablaLineaSeleccionadaUsuario(JTable tabla){
        if(tableUsuario.getSelectedRow() != -1){
            habilitaDatosUsuario();
            txtidUsuario.setText(String.valueOf(usuarios.get(tabla.getSelectedRow()).getId()));
            txtNombreUsuario.setText(usuarios.get(tabla.getSelectedRow()).getNombre());
            txtApellidosUsuario.setText(usuarios.get(tabla.getSelectedRow()).getApellido());
            txtDireccionUsuario.setText(usuarios.get(tabla.getSelectedRow()).getDireccion());
        }
        else{
            txtidUsuario.setText("");
            txtNombreUsuario.setText("");
            txtApellidosUsuario.setText("");
            txtDireccionUsuario.setText("");
        }
    }

    public void guardarUsuarios(){
        try {
            Usuario u1 = new Usuario();
            u1.setNombre(txtNombreUsuario.getText());
            u1.setApellido(txtApellidosUsuario.getText());
            u1.setDireccion(txtDireccionUsuario.getText());
            u1.setAdministrador(checkAdministrador.isSelected());
            u1.setContrasena(txtContrasenaUsuario.getText());
            UsuarioDao u1Dao = new UsuarioDao();
            u1Dao.crearUsuario(u1);
        } catch (SQLException ex) {
            JOptionPane.showMessageDialog(null, "¡Error al guardar!, intente de nuevo" + ex);
        }
    }

    public void listarUsuarios() throws SQLException{
        UsuarioDao uDao = new UsuarioDao();
        usuarios = uDao.listarUsuarios();
        mostrarBusquedaUsuarios(usuarios);
    }

    public void listarUsuariosBusqueda() throws SQLException{
        UsuarioDao uDao = new UsuarioDao();
        usuarios = uDao.getLista("%" + txtBuscarUsuario.getText() + "%");
        mostrarBusquedaUsuarios(usuarios);
    }

    private void mostrarBusquedaUsuarios(ArrayList<Usuario> usuario) {
        while(tablaUsuarios.getRowCount() > 0){
            tablaUsuarios.removeRow(0);
        }

        if(usuario.isEmpty()){
            JOptionPane.showMessageDialog(null, "Ningún usuario encontrado");
        }
        else{
            String[] linea = new String[]{null, null, null, null, null, null};
            for (int i = 0; i < usuario.size(); i++){
                tablaUsuarios.addRow(linea);
                tablaUsuarios.setValueAt(usuario.get(i).getId(), i, 0);
                tablaUsuarios.setValueAt(usuario.get(i).getNombre(), i, 1);
                tablaUsuarios.setValueAt(usuario.get(i).getApellido(), i, 2);
                tablaUsuarios.setValueAt(usuario.get(i).getDireccion(), i, 3);
            }
         }
    }

    public void eliminarUsuario() throws SQLException{
        int resp = JOptionPane.showConfirmDialog(this, "¿Desea realmente eliminar el usuario?",
                "Confirmacion", JOptionPane.YES_NO_OPTION);
        if (resp == JOptionPane.YES_NO_OPTION) {
            UsuarioDao uDao = new UsuarioDao();
            uDao.eliminarUsuario(usuarios.get(tableUsuario.getSelectedRow()));
            mostrarBusquedaUsuarios(usuarios);
        }
    }

    /****************************CLIENTE************************************/
    public boolean verificarDatosCliente(){
        if (!txtNombreCliente.getText().equals("") && !txtApellidosCliente.getText().equals("") &&
            !txtDireccionCliente.getText().equals("")){
            return true;
        }
        else{
            JOptionPane.showMessageDialog(null, "¡Error! Complete todos los formularios");
            return false;
        }
    }

    private void tablaLineaSeleccionadaCliente(JTable tabla){
        if(tableCliente.getSelectedRow() != -1){
            habilitaDatosCliente();
            txtidCliente.setText(String.valueOf(clientes.get(tabla.getSelectedRow()).getId()));
            txtNombreCliente.setText(clientes.get(tabla.getSelectedRow()).getNombre());
            txtApellidosCliente.setText(clientes.get(tabla.getSelectedRow()).getApellido());
            txtDireccionCliente.setText(clientes.get(tabla.getSelectedRow()).getDireccion());
            txtTelefonoCliente.setText(clientes.get(tabla.getSelectedRow()).getTel());
        }
        else{
            txtidCliente.setText("");
            txtNombreCliente.setText("");
            txtApellidosCliente.setText("");
            txtDireccionCliente.setText("");
            txtTelefonoCliente.setText("");
        }
    }

    public void guardarClientes(){
        try {
            Cliente c1 = new Cliente();
            c1.setNombre(txtNombreCliente.getText());
            c1.setApellido(txtApellidosCliente.getText());
            c1.setDireccion(txtDireccionCliente.getText());
            c1.setTel(txtTelefonoCliente.getText());
            c1.setEsHuesped(checkCliente.isSelected());
            ClienteDao c1Dao = new ClienteDao();
            c1Dao.crearCliente(c1);
        } catch (SQLException ex) {
            JOptionPane.showMessageDialog(null, "¡Error al guardar!, intente de nuevo" + ex);
        }
    }

    public void listarClientes() throws SQLException{
        ClienteDao cDao = new ClienteDao();
        clientes = cDao.listarClientes();
        mostrarBusquedaClientes(clientes);
    }

    public void listarClientesBusqueda() throws SQLException{
        ClienteDao cDao = new ClienteDao();
        clientes = cDao.getLista("%" + txtBuscarCliente.getText() + "%");
        mostrarBusquedaClientes(clientes);
    }

    private void mostrarBusquedaClientes(ArrayList<Cliente> cliente) {
        while(tablaClientes.getRowCount() > 0){
            tablaClientes.removeRow(0);
        }

        if(cliente.isEmpty()){
            JOptionPane.showMessageDialog(null, "Ningún cliente encontrado");
        }
        else{
            String[] linea = new String[]{null, null, null, null, null, null};
            for (int i = 0; i < cliente.size(); i++){
                tablaClientes.addRow(linea);
                tablaClientes.setValueAt(cliente.get(i).getId(), i, 0);
                tablaClientes.setValueAt(cliente.get(i).getNombre(), i, 1);
                tablaClientes.setValueAt(cliente.get(i).getApellido(), i, 2);
                tablaClientes.setValueAt(cliente.get(i).getDireccion(), i, 3);
                tablaClientes.setValueAt(cliente.get(i).getTel(), i, 4);
            }
         }
    }

    public void eliminarCliente() throws SQLException{
        int resp = JOptionPane.showConfirmDialog(this, "¿Desea realmente eliminar el cliente?",
                "Confirmacion", JOptionPane.YES_NO_OPTION);
        if (resp == JOptionPane.YES_NO_OPTION) {
            ClienteDao cDao = new ClienteDao();
            cDao.eliminarCliente(clientes.get(tableCliente.getSelectedRow()));
            mostrarBusquedaClientes(clientes);
        }
    }

    /****************************PAQUETES************************************/
    public boolean verificarDatosPaquete(){
        if (!txtNombrePaquete.getText().equals("") && !txtDescripcionPaquete.getText().equals("") &&
            !txtPrecioPaquete.getText().equals("")){
            return true;
        }
        else{
            JOptionPane.showMessageDialog(null, "¡Error! Complete todos los formularios");
            return false;
        }
    }

    private void tablaLineaSeleccionadaPaquete(JTable tabla){
        if(tablePaquete.getSelectedRow() != -1){
            habilitaDatosPaquete();
            txtidPaquete.setText(String.valueOf(paquetes.get(tabla.getSelectedRow()).getId()));
            txtNombrePaquete.setText(paquetes.get(tabla.getSelectedRow()).getNombre());
            txtDescripcionPaquete.setText(paquetes.get(tabla.getSelectedRow()).getDescripcion());
            txtPrecioPaquete.setText(String.valueOf(paquetes.get(tabla.getSelectedRow()).getPrecio()));
        }
        else{
            txtidPaquete.setText("");
            txtNombrePaquete.setText("");
            txtDescripcionPaquete.setText("");
            txtPrecioPaquete.setText("");
        }
    }

    public void guardarPaquete(){
        try {
            Paquete p1 = new Paquete();
            p1.setNombre(txtNombrePaquete.getText());
            p1.setDescripcion(txtDescripcionPaquete.getText());
           // p1.setPrecio(txtPrecioPaquete.getText().);

            PaqueteDao p1Dao = new PaqueteDao();
            p1Dao.crearPaquete(p1);
        } catch (SQLException ex) {
            JOptionPane.showMessageDialog(null, "¡Error al guardar!, intente de nuevo" + ex);
        }
    }

    public void listarPaquetes() throws SQLException{
        PaqueteDao pDao = new PaqueteDao();
        paquetes = pDao.listarPaquetes("%" + txtBuscarPaquete.getText() + "%");
        mostrarBusquedaPaquetes(paquetes);
    }

    private void mostrarBusquedaPaquetes(ArrayList<Paquete> paquete) {
        while(tablaPaquetes.getRowCount() > 0){
            tablaPaquetes.removeRow(0);
        }

        if(paquete.isEmpty()){
            JOptionPane.showMessageDialog(null, "Ningún paquete encontrado");
        }
        else{
            String[] linea = new String[]{null, null, null, null, null, null};
            for (int i = 0; i < paquete.size(); i++){
                tablaPaquetes.addRow(linea);
                tablaPaquetes.setValueAt(paquete.get(i).getId(), i, 0);
                tablaPaquetes.setValueAt(paquete.get(i).getNombre(), i, 1);
                tablaPaquetes.setValueAt(paquete.get(i).getDescripcion(), i, 2);
                tablaPaquetes.setValueAt(paquete.get(i).getPrecio(), i, 3);
            }
         }
    }

    public void eliminarPaquete() throws SQLException{
        int resp = JOptionPane.showConfirmDialog(this, "¿Desea realmente eliminar el paquete?",
                "Confirmacion", JOptionPane.YES_NO_OPTION);
        if (resp == JOptionPane.YES_NO_OPTION) {
            PaqueteDao pDao = new PaqueteDao();
            pDao.eliminarPaquete(paquetes.get(tablePaquete.getSelectedRow()));
            mostrarBusquedaPaquetes(paquetes);
        }
    }

    public void modificarPaquete() throws SQLException{
        if(tablePaquete.getSelectedRow() != 1){
            if(verificarDatosPaquete()){
                Paquete p1 = new Paquete();
                PaqueteDao p1Dao = new PaqueteDao();
                p1.setId(Integer.valueOf(txtidPaquete.getText()));
                p1.setNombre(txtNombrePaquete.getText());
                p1.setDescripcion(txtDescripcionPaquete.getText());
                p1.setPrecio(Double.valueOf(txtPrecioPaquete.getText()));
                p1Dao.modificarPaquete(p1);
                JOptionPane.showMessageDialog(null, "Paquete agregado con exito");
            }
        }
    }

    /****************************SERVICIOS***********************/
    public boolean verificarDatosServicio(){
        if (!txtNombreServicio.getText().equals("") && !txtPrecioServicio.getText().equals("")){
            return true;
        }
        else{
            JOptionPane.showMessageDialog(null, "¡Error! Complete todos los formularios");
            return false;
        }
    }

    private void tablaLineaSeleccionadaServicio(JTable tabla){
        if(tableServicio.getSelectedRow() != -1){
            habilitaDatosServicio();
            txtidServicio.setText(String.valueOf(servicios.get(tabla.getSelectedRow()).getId()));
            txtNombreServicio.setText(servicios.get(tabla.getSelectedRow()).getNombre());
            txtPrecioServicio.setText(String.valueOf(servicios.get(tabla.getSelectedRow()).getPrecio()));
        }
        else{
            txtidServicio.setText("");
            txtNombreServicio.setText("");
            txtPrecioServicio.setText("");
        }
    }

    public void guardarServicios(){
        try {
            Servicio s1 = new Servicio();
            s1.setNombre(txtNombreServicio.getText());
            s1.setPrecio(Double.valueOf(txtPrecioServicio.getText()));
            ServicioDao s1Dao = new ServicioDao();
            s1Dao.crearServicio(s1);
        } catch (SQLException ex) {
            JOptionPane.showMessageDialog(null, "¡Error al guardar!, intente de nuevo" + ex);
        }
    }

    public void listarServicios() throws SQLException{
        ServicioDao sDao = new ServicioDao();
        servicios = sDao.listarServicios();
        mostrarBusquedaServicios(servicios);
    }

    public void listarServiciosBusqueda() throws SQLException{
        ServicioDao sDao = new ServicioDao();
        servicios = sDao.listarServicios("%" + txtBuscarServicio.getText() + "%");
        mostrarBusquedaServicios(servicios);
    }

    private void mostrarBusquedaServicios(ArrayList<Servicio> servicio) {
        while(tablaServicios.getRowCount() > 0){
            tablaServicios.removeRow(0);
        }

        if(servicio.isEmpty()){
            JOptionPane.showMessageDialog(null, "Ningún servicio encontrado");
        }
        else{
            String[] linea = new String[]{null, null, null, null, null, null};
            for (int i = 0; i < servicio.size(); i++){
                tablaServicios.addRow(linea);
                tablaServicios.setValueAt(servicio.get(i).getId(), i, 0);
                tablaServicios.setValueAt(servicio.get(i).getNombre(), i, 1);
                tablaServicios.setValueAt(servicio.get(i).getPrecio(), i, 2);
            }
         }
    }

    public void eliminarServicio() throws SQLException{
        int resp = JOptionPane.showConfirmDialog(this, "¿Desea realmente eliminar el servicio?",
                "Confirmacion", JOptionPane.YES_NO_OPTION);
        if (resp == JOptionPane.YES_NO_OPTION) {
            ServicioDao sDao = new ServicioDao();
            sDao.eliminarServicio(servicios.get(tableServicio.getSelectedRow()));
            mostrarBusquedaServicios(servicios);
        }
    }

    public void modificarServicio() throws SQLException{
        if(tableServicio.getSelectedRow() != 1){
            if(verificarDatosServicio()){
                Servicio s1 = new Servicio();
                ServicioDao s1Dao = new ServicioDao();
                s1.setId(Integer.valueOf(txtidServicio.getText()));
                s1.setNombre(txtNombreServicio.getText());
                s1.setPrecio(Double.valueOf(txtPrecioServicio.getText()));
                s1Dao.modificarServicio(s1);
                JOptionPane.showMessageDialog(null, "Servicio modificado con exito");
            }
        }
    }

    private void jTTtablaLineaSeleccionada(JTable tabla){}
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JTabbedPane PanelPrincipal;
    private javax.swing.JButton btnAgregarHabitacion;
    private javax.swing.JButton btnAgregarHabitacion1;
    private javax.swing.JButton btnAgregarHabitacion2;
    private javax.swing.JButton btnBuscarCliente;
    private javax.swing.JButton btnBuscarPaquete;
    private javax.swing.JButton btnBuscarRenta;
    private javax.swing.JButton btnBuscarReserva;
    private javax.swing.JButton btnBuscarServicio;
    private javax.swing.JButton btnBuscarUsuario;
    private javax.swing.JButton btnEliminarCliente;
    private javax.swing.JButton btnEliminarPaquete;
    private javax.swing.JButton btnEliminarReserva;
    private javax.swing.JButton btnEliminarReserva1;
    private javax.swing.JButton btnEliminarServicio;
    private javax.swing.JButton btnEliminarUsuario;
    private javax.swing.JButton btnEntrar;
    private javax.swing.JButton btnGuardarCliente;
    private javax.swing.JButton btnGuardarPaquete;
    private javax.swing.JButton btnGuardarReserva;
    private javax.swing.JButton btnGuardarReserva1;
    private javax.swing.JButton btnGuardarServicio;
    private javax.swing.JButton btnGuardarUsuario;
    private javax.swing.JButton btnModificarPaquete;
    private javax.swing.JButton btnModificarServicio;
    private javax.swing.JButton btnMostrar;
    private javax.swing.JButton btnNuevoCliente;
    private javax.swing.JButton btnNuevoPaquete;
    private javax.swing.JButton btnNuevoReserva;
    private javax.swing.JButton btnNuevoReserva1;
    private javax.swing.JButton btnNuevoServicio;
    private javax.swing.JButton btnNuevoUsuario;
    private javax.swing.JButton btnPagar;
    private javax.swing.JButton btnSalir;
    private javax.swing.JButton btnVerIngresos;
    private javax.swing.JCheckBox checkAdministrador;
    private javax.swing.JCheckBox checkCliente;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanelBotonesCliente;
    private javax.swing.JPanel jPanelBotonesPaquete;
    private javax.swing.JPanel jPanelBotonesReserva;
    private javax.swing.JPanel jPanelBotonesReserva1;
    private javax.swing.JPanel jPanelBotonesServicio;
    private javax.swing.JPanel jPanelBotonesUsuario;
    private javax.swing.JPanel jPanelDatosCliente;
    private javax.swing.JPanel jPanelDatosCuenta;
    private javax.swing.JPanel jPanelDatosIngresos;
    private javax.swing.JPanel jPanelDatosPaquete;
    private javax.swing.JPanel jPanelDatosReserva;
    private javax.swing.JPanel jPanelDatosReserva1;
    private javax.swing.JPanel jPanelDatosServicio;
    private javax.swing.JPanel jPanelDatosUsuario;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane10;
    private javax.swing.JScrollPane jScrollPane11;
    private javax.swing.JScrollPane jScrollPane12;
    private javax.swing.JScrollPane jScrollPane13;
    private javax.swing.JScrollPane jScrollPane14;
    private javax.swing.JScrollPane jScrollPane15;
    private javax.swing.JScrollPane jScrollPane16;
    private javax.swing.JScrollPane jScrollPane17;
    private javax.swing.JScrollPane jScrollPane18;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JScrollPane jScrollPane7;
    private javax.swing.JScrollPane jScrollPane8;
    private javax.swing.JScrollPane jScrollPane9;
    private javax.swing.JLabel lblAdministradorUsuario;
    private javax.swing.JLabel lblApellidosCliente;
    private javax.swing.JLabel lblApellidosUsuario;
    private javax.swing.JLabel lblCliente;
    private javax.swing.JLabel lblCliente1;
    private javax.swing.JLabel lblContrasena;
    private javax.swing.JLabel lblContrasenaUsuario;
    private javax.swing.JLabel lblDescripcionPaquete;
    private javax.swing.JLabel lblDireccionCliente;
    private javax.swing.JLabel lblDireccionUsuario;
    private javax.swing.JLabel lblFecha;
    private javax.swing.JLabel lblFechaFin;
    private javax.swing.JLabel lblFechaFin1;
    private javax.swing.JLabel lblFechaFinIngresos;
    private javax.swing.JLabel lblFechaInicio;
    private javax.swing.JLabel lblFechaInicio1;
    private javax.swing.JLabel lblFechaInicioIngresos;
    private javax.swing.JLabel lblHabitacionesDisponibles;
    private javax.swing.JLabel lblHabitacionesDisponibles1;
    private javax.swing.JLabel lblHuesped;
    private javax.swing.JLabel lblNombreCliente;
    private javax.swing.JLabel lblNombrePaquete;
    private javax.swing.JLabel lblNombreServicio;
    private javax.swing.JLabel lblNombreUsuario;
    private javax.swing.JLabel lblPrecioPaquete;
    private javax.swing.JLabel lblPrecioServicio;
    private javax.swing.JLabel lblTelefonoCliente;
    private javax.swing.JLabel lblTotal;
    private javax.swing.JLabel lblUsuario;
    private javax.swing.JLabel lblidCliente;
    private javax.swing.JLabel lblidPaquete;
    private javax.swing.JLabel lblidReserva;
    private javax.swing.JLabel lblidReserva1;
    private javax.swing.JLabel lblidServicio;
    private javax.swing.JLabel lblidUsuario;
    private javax.swing.JTable tableCliente;
    private javax.swing.JTable tableClientesRegistrados;
    private javax.swing.JTable tableClientesRegistrados1;
    private javax.swing.JTable tableCuenta;
    private javax.swing.JTable tableHabitacionesDisponibles;
    private javax.swing.JTable tableHabitacionesDisponibles1;
    private javax.swing.JTable tableHabitacionesReservadas;
    private javax.swing.JTable tableHabitacionesReservadas1;
    private javax.swing.JTable tableIngresos;
    private javax.swing.JTable tablePaquete;
    private javax.swing.JTable tablePaquetes;
    private javax.swing.JTable tableReserva;
    private javax.swing.JTable tableReserva1;
    private javax.swing.JTable tableServicio;
    private javax.swing.JTable tableServicios;
    private javax.swing.JTable tableServicios2;
    private javax.swing.JTable tableServiciosEscogidos;
    private javax.swing.JTable tableUsuario;
    private javax.swing.JTextField txtApellidosCliente;
    private javax.swing.JTextField txtApellidosUsuario;
    private javax.swing.JTextField txtBuscarCliente;
    private javax.swing.JTextField txtBuscarPaquete;
    private javax.swing.JTextField txtBuscarRenta;
    private javax.swing.JTextField txtBuscarReserva;
    private javax.swing.JTextField txtBuscarServicio;
    private javax.swing.JTextField txtBuscarUsuario;
    private javax.swing.JPasswordField txtContrasena;
    private javax.swing.JTextField txtContrasenaUsuario;
    private javax.swing.JTextField txtDescripcionPaquete;
    private javax.swing.JTextField txtDireccionCliente;
    private javax.swing.JTextField txtDireccionUsuario;
    private javax.swing.JTextField txtFecha;
    private javax.swing.JTextField txtFechaFin;
    private javax.swing.JTextField txtFechaFin1;
    private javax.swing.JTextField txtFechaFinIngresos;
    private javax.swing.JTextField txtFechaInicio;
    private javax.swing.JTextField txtFechaInicio1;
    private javax.swing.JTextField txtFechaInicioIngresos;
    private javax.swing.JTextField txtInfoTrabajador;
    private javax.swing.JTextField txtNombreCliente;
    private javax.swing.JTextField txtNombrePaquete;
    private javax.swing.JTextField txtNombreServicio;
    private javax.swing.JTextField txtNombreUsuario;
    private javax.swing.JTextField txtPrecioPaquete;
    private javax.swing.JTextField txtPrecioServicio;
    private javax.swing.JTextField txtTelefonoCliente;
    private javax.swing.JTextField txtTotal;
    private javax.swing.JTextField txtUsuario;
    private javax.swing.JTextField txtidCliente;
    private javax.swing.JTextField txtidPaquete;
    private javax.swing.JTextField txtidReserva;
    private javax.swing.JTextField txtidReserva1;
    private javax.swing.JTextField txtidServicio;
    private javax.swing.JTextField txtidUsuario;
    // End of variables declaration//GEN-END:variables

    
}
